Package org.exolab.castor.persist.spi

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


            lock = typeInfo.acquire(internaloid, tx, ObjectLock.ACTION_CREATE, 0);

            internaloid = lock.getOID();

            Identity newids = typeInfo._molder.create(tx, internaloid, lock, object);
            succeed = true;

            internaloid.setDbLock(true);

            newoid = new OID(internaloid.getMolder(), internaloid.getDepends(), newids);
View Full Code Here


    public void testGeneral() throws PersistenceException {
        LOG.info("Running testGeneral...");

        Calendar cal = Calendar.getInstance();
        Identity fullname = new Identity("First", "Person");
        LazyEmployee loadPerson;

        _db.begin();
        loadPerson = (LazyEmployee) _db.load(LazyEmployee.class, fullname);
       
View Full Code Here

    }

    public void testCollection() throws PersistenceException {
        LOG.info("Running testCollection...");

        Identity fullname = new Identity("First", "Person");
        LazyPerson loadPerson;

        // test java.util.Collection.clear() for lazy loading (bug 801)
        _db.begin();
        loadPerson = (LazyEmployee) _db.load(LazyEmployee.class, fullname);
View Full Code Here

        // Tests iterating over a lazy-loaded Collection that has
        // had data added

        ArrayList masterData = new ArrayList();
        Identity fullname = new Identity("First", "Person");
        LazyPerson loadPerson;

        // test java.util.Collection.clear() for lazy loading (bug 801)
        _db.begin();
        loadPerson = (LazyEmployee) _db.load(LazyEmployee.class, fullname);
View Full Code Here

        LOG.info("Running testIterWithDelete...");

        // Tests iterating over a lazy-loaded Collection that has
        // had data deleted
        ArrayList masterData = new ArrayList();
        Identity fullname = new Identity("First", "Person");
        LazyEmployee loadPerson;

        // First add a record, then commit
        _db.begin();
        loadPerson = (LazyEmployee) _db.load(LazyEmployee.class, fullname);
View Full Code Here

    }

    public void testComplex() throws PersistenceException {
        LOG.info("Running testComplex...");

        Identity fullname = new Identity("First", "Person");
        LazyEmployee loadPerson;

        // set up the data object
        _db.begin();
        loadPerson = (LazyEmployee) _db.load(LazyEmployee.class, fullname);
View Full Code Here

        }
        _db.commit();
    }

    public void testMasterUpdate() throws PersistenceException {
        Identity fullname = new Identity("First", "Person");
        LazyPerson loadPerson;

        // 1. load master object, add a new dependent object and commit
        _db.begin();
        loadPerson = (LazyEmployee) _db.load(LazyEmployee.class, fullname);
View Full Code Here

    }

    public void testLazyCollectionRollback() throws PersistenceException {
        LOG.info("Running testLazyCollectionRollback...");

        Identity fullname = new Identity("First", "Person");
        LazyEmployee loadPerson;

        // set up the data object
        _db.begin();
        loadPerson = (LazyEmployee) _db.load(LazyEmployee.class, fullname);
View Full Code Here

     * @throws PersistenceException If a problem occured resolving the object's cache membership.
     */
    public boolean isCached (final Class cls, final Object identity) throws PersistenceException {
        if (_transactionContext != null && _transactionContext.isOpen()) {
            return _transactionContext.isCached(_lockEngine.getClassMolder(cls), cls,
                    new Identity(identity));
        }
       
        throw new PersistenceException("isCached() has to be called within an active transaction.");
    }
View Full Code Here

     */
    public void expireCache(final Class type, final Object[] identity) throws PersistenceException {
        testForOpenDatabase();
        ClassMolder molder = _lockEngine.getClassMolder(type);
        for (int i = 0; i < identity.length; i++) {
            _transactionContext.expireCache(molder, new Identity(identity[i]));
        }
    }
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.