Package org.odmg

Examples of org.odmg.Implementation


        MainObject obj_1 = new MainObject(null, name);
        MainObject obj_2 = new MainObject(null, name);
        MainObject obj_3 = new MainObject(null, name);

        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);

        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(obj_1, Transaction.WRITE);
        tx.lock(obj_2, Transaction.WRITE);
        tx.lock(obj_3, Transaction.WRITE);
        tx.commit();
View Full Code Here


        MainObject obj_2 = new MainObject(null, name);
        SingleReference s_ref_4 = new SingleReference(nameSingleRef);
        obj_2.setSingleReference(s_ref_4);

        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);

        TransactionExt tx = (TransactionExt) odmg.newTransaction();
        tx.begin();
        db.makePersistent(s_ref_4);
        db.makePersistent(obj_2);
        tx.commit();
View Full Code Here

        obj_1.addReference(ref_4);

        obj_1.setSingleReference(s_ref_3);
        obj_2.setSingleReference(s_ref_4);

        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);

        Transaction tx = odmg.newTransaction();
        tx.begin();
        db.makePersistent(s_ref_1);
        db.makePersistent(s_ref_2);
        db.makePersistent(s_ref_3);
        db.makePersistent(s_ref_4);
View Full Code Here

        String oql = "select colorProfiles from " + ColorProfileDesc.class.getName() + " where id=" + id;
        List profiles = null;
       
        // Get transaction context
        ODMGXAWrapper txw = new ODMGXAWrapper();
        Implementation odmg = ODMG.getODMGImplementation();
       
        try {
            OQLQuery query = odmg.newOQLQuery();
            query.create( oql );
            profiles = (List) query.execute();
            txw.commit();
        } catch (Exception e ) {
            log.warn( "Error fetching record: " + e.getMessage() );
View Full Code Here

                " where id > 0";
        List profiles = null;
       
        // Get transaction context
        ODMGXAWrapper txw = new ODMGXAWrapper();
        Implementation odmg = ODMG.getODMGImplementation();
       
        try {
            OQLQuery query = odmg.newOQLQuery();
            query.create( oql );
            txw.flush();
            profiles = (List) query.execute();
            txw.commit();
        } catch (Exception e ) {
View Full Code Here

            String oql = "select info from " + DbInfo.class.getName();
            List infos = null;
       
            // Get transaction context
            ODMGXAWrapper txw = new ODMGXAWrapper();
            Implementation odmg = ODMG.getODMGImplementation();
       
            try {
                OQLQuery query = odmg.newOQLQuery();
                query.create( oql );
                infos = (List) query.execute();
                txw.commit();
            } catch (Exception e ) {
                txw.abort();
View Full Code Here

        cutoffDateCrit.addLessThan( "instances.checkTime", startTime );
        dateCrit.addOrCriteria( cutoffDateCrit );
        crit.addAndCriteria( dateCrit );
       
        ODMGXAWrapper txw = new ODMGXAWrapper();
  Implementation odmg = ODMG.getODMGImplementation();
  Transaction tx = odmg.currentTransaction();
        Collection result = null;
  try {
      PersistenceBroker broker = ((HasBroker) tx).getBroker();
      QueryByCriteria q = new QueryByCriteria( PhotoInfo.class, crit );
      result = broker.getCollectionByQuery( q );
View Full Code Here

        String oql = "select photos from " + PhotoInfo.class.getName();
        List photos = null;
       
        // Get transaction context
        ODMGXAWrapper txw = new ODMGXAWrapper();
        Implementation odmg = ODMG.getODMGImplementation();
       
        try {
            OQLQuery query = odmg.newOQLQuery();
            query.create( oql );
            photos = (List) query.execute();
            txw.commit();
        } catch (Exception e ) {
            txw.abort();
View Full Code Here

    {
        // get facade instance
        // use one Implementation instance per database
        // it's recommended to share the Implementation and Database instances
        // in the application, instead of always instantiate and open it.
        Implementation odmg = OJB.getInstance();
        Database       db   = odmg.newDatabase();

        // open database
        try
        {
            db.open(DATABASE_NAME, Database.OPEN_READ_WRITE);
View Full Code Here

        MainObject obj_1 = new MainObject(null, name);
        MainObject obj_2 = new MainObject(null, name);
        MainObject obj_3 = new MainObject(null, name);

        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);

        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(obj_1, Transaction.WRITE);
        tx.lock(obj_2, Transaction.WRITE);
        tx.lock(obj_3, Transaction.WRITE);
        tx.commit();
View Full Code Here

TOP

Related Classes of org.odmg.Implementation

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.