Package org.exolab.castor.persist.spi

Examples of org.exolab.castor.persist.spi.Identity


    throws PersistenceException {
        if (object == null) { throw new NullPointerException(); }

        LockEngine engine = molder.getLockEngine();
       
        Identity identity = molder.getActualIdentity(this, object);
        if (molder.isDefaultIdentity(identity)) { identity = null; }

        OID oid = new OID(molder, depended, identity);

        // Check the object is in the transaction.
View Full Code Here


        _loaded = new HashMap();
    }


    public boolean add(final Object o) {
        Identity id = _molder.getIdentity(_tx, o);
        // boolean changed = false;
        if (_ids.contains(id)) {
            if (_deleted.contains(id)) {
                _deleted.remove(id);
                _loaded.put(id, o);
View Full Code Here

            itor.remove();
        }
    }

    public boolean contains(final Object o) {
        Identity id = _molder.getIdentity(_tx, o);
        if (_added.contains(id)) {
            return true;
        }
        if (_ids.contains(id) && !_deleted.contains(id)) {
            return true;
View Full Code Here

    public Iterator iterator() {
        return new IteratorImp(this);
    }

    public boolean remove(final Object o) {
        Identity id = _molder.getIdentity(_tx, o);

        if (_deleted.contains(id)) {
            return false;
        }
View Full Code Here

            if (!hasNext()) {
                throw new NoSuchElementException(
                        "Read after the end of iterator!");
            }

            Identity id;
            Object o;
            if (_cursor < _added.size()) {
                id = (Identity) _added.get(_cursor++);
                o = _loaded.get(id);
                if (o != null) {
View Full Code Here

        if (object instanceof LazyCGLIB) {
            LazyCGLIB cgObject = (LazyCGLIB) object;
           
            // TODO [WG] We still might have an option for some serious optimization
            // here if the instance has not been materialized yet.
            Identity identity = cgObject.interceptedIdentity();
            ClassMolder molder = cgObject.interceptedClassMolder();
            LockEngine engine = molder.getLockEngine();
           
            // Get the OID we're looking for.
            OID oid = new OID(molder, identity);
View Full Code Here

  only.setLastName("guttmann");
  _db.create(only);
  _db.commit();
 
  _db.begin();
  Identity identity = new Identity(new Object[] {"werner", "guttmann"});
  PrimaryKeysOnly searched = (PrimaryKeysOnly) _db.load(PrimaryKeysOnly.class, identity);
  assertNotNull(searched);
  assertEquals("werner", searched.getFirstName());
  assertEquals("guttmann", searched.getLastName());
  _db.commit();
View Full Code Here

                    Object[] temps = new Object[jdoFieldNature.getSQLName().length];
                    for (int j = 0; j < jdoFieldNature.getSQLName().length; j++) {
                        temps[j] = SQLTypeInfos.getValue(
                                rs, columnIndex++, java.sql.Types.JAVA_OBJECT);
                    }
                    temp = new Identity(temps);
                }
               
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Obtained value " + temp + " for additional (extending) identity "
                            + potentialClassDescriptor.getJavaClass().getName() + "/"
View Full Code Here

TOP

Related Classes of org.exolab.castor.persist.spi.Identity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.