Package org.apache.ojb.broker.util

Examples of org.apache.ojb.broker.util.GUID


        this.implicitLocking = implementation.isImplicitLocking();
        this.ordering = implementation.isOrdering();
        //this.noteUserOrdering = implementation.isNoteUserOrder();

        // assign a globally uniqe id to this tx
        txGUID = new GUID().toString();
        curDB = implementation.getCurrentDatabase();
        namedRootsMap = new NamedRootsMap(this);
    }
View Full Code Here


    public void YYYtestCacheIsolation() throws Exception
    {
        Object[] pk = new Object[]{new Long(42)};
        Identity oid = new Identity(Article.class, InterfaceArticle.class, pk);

        GUID guid = new GUID();

        PersistenceBroker broker1 = PersistenceBrokerFactory.defaultPersistenceBroker();
        broker1.beginTransaction();

        Article a1 = (Article) broker1.getObjectByQuery(new QueryByIdentity(oid));
        String originalName = a1.getArticleName();
        a1.setArticleName(guid.toString());

// start a second transaction
        PersistenceBroker broker2 = PersistenceBrokerFactory.defaultPersistenceBroker();
        broker2.beginTransaction();

        Article a2 = (Article) broker2.getObjectByQuery(new QueryByIdentity(oid));

        assertEquals(guid.toString(), a1.getArticleName());
        assertEquals(originalName, a2.getArticleName());
        assertNotSame(a1, a2);


        broker1.commitTransaction();
View Full Code Here

     */
    public Object javaToSql(Object source)
    {
        if (source instanceof GUID)
        {
          GUID guid = (GUID) source;
          return guid.toString();
        }
        return source;
    }
View Full Code Here

     */
    public Object sqlToJava(Object source)
    {    
      if (source instanceof String)
      {
          return new GUID((String) source);
      }
      return source;
    }
View Full Code Here

    public void YYYtestCacheIsolation() throws Exception
    {
        Object[] pk = new Object[]{new Long(42)};
        Identity oid = new Identity(Article.class, InterfaceArticle.class, pk);

        GUID guid = new GUID();

        PersistenceBroker broker1 = PersistenceBrokerFactory.defaultPersistenceBroker();
        broker1.beginTransaction();

        Article a1 = (Article) broker1.getObjectByQuery(new QueryByIdentity(oid));
        String originalName = a1.getArticleName();
        a1.setArticleName(guid.toString());

// start a second transaction
        PersistenceBroker broker2 = PersistenceBrokerFactory.defaultPersistenceBroker();
        broker2.beginTransaction();

        Article a2 = (Article) broker2.getObjectByQuery(new QueryByIdentity(oid));

        assertEquals(guid.toString(), a1.getArticleName());
        assertEquals(originalName, a2.getArticleName());
        assertNotSame(a1, a2);


        broker1.commitTransaction();
View Full Code Here

     */
    public TransactionImpl(DatabaseImpl theCurrentDB)
    {
        txManager = TxManagerFactory.instance();
        // assign a globally uniqe id to this tx
        txGUID = new GUID().toString();
        curDB = theCurrentDB;
    }
View Full Code Here

    {
        this.implementation = implementation;
        this.impliciteWriteLocks = implementation.isImpliciteWriteLocks();
        this.implicitLocking = implementation.isImplicitLocking();
        // assign a globally uniqe id to this tx
        txGUID = new GUID().toString();
        curDB = implementation.getCurrentDatabase();
    }
View Full Code Here

     * Constructor for GuidTestEntity.
     */
    public GuidTestEntity()
    {
        super();
        guid = new GUID();
        value = new Date().toString();
    }
View Full Code Here

     */
    public Object javaToSql(Object source)
    {
        if (source instanceof GUID)
        {
          GUID guid = (GUID) source;
          return guid.toString();
        }
        return source;
    }
View Full Code Here

     */
    public Object sqlToJava(Object source)
    {    
      if (source instanceof String)
      {
          return new GUID((String) source);
      }
      return source;
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.util.GUID

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.