Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOKeyGlobalID


            }
        }
        String gidString;
        if(gid instanceof EOKeyGlobalID) {
            // ak: when you use 24 byte PKs, the output is unreadable otherwise
            EOKeyGlobalID kgid = (EOKeyGlobalID)gid;
            gidString = "<" +  kgid.entityName() + ": [" ;
            EOEntity entity = ERXEOAccessUtilities.entityNamed(null, kgid.entityName());
            NSArray pks = entity.primaryKeyAttributes();
            NSArray values = kgid.keyValuesArray();
            EOSQLExpressionFactory expressionFactory = context.database().adaptor().expressionFactory();
            EOSQLExpression expression = null;
            if (expressionFactory != null) {
              expression = expressionFactory.expressionForEntity(entity);
            }
View Full Code Here


  }

  @SuppressWarnings("boxing")
  public void testEquals() {

    EOKeyGlobalID kgid1 = EOKeyGlobalID.globalIDWithEntityName(Company.ENTITY_NAME, new Integer[] { ERXTestUtilities.pkOne(ec, co) } );
   
    ERXKeyGlobalID xkgid1 = ERXKeyGlobalID.globalIDForGID(kgid1);
    ERXKeyGlobalID xkgid2 = ERXKeyGlobalID.globalIDForGID(kgid1);

    Assert.assertFalse(kgid1.equals(xkgid1));
    Assert.assertFalse(xkgid1.equals(kgid1));

    Assert.assertTrue(xkgid1.equals(xkgid2));
    Assert.assertTrue(xkgid2.equals(xkgid1));
   
    EOEditingContext ec2 = ERXEC.newEditingContext();
    EOEnterpriseObject co2 = ERXEOControlUtilities.localInstanceOfObject(ec2, co);

    EOKeyGlobalID kgid2 = EOKeyGlobalID.globalIDWithEntityName(Company.ENTITY_NAME, new Integer[] { ERXTestUtilities.pkOne(ec2, co2) } );
    ERXKeyGlobalID xkgid3 = ERXKeyGlobalID.globalIDForGID(kgid2);

    Assert.assertFalse(kgid2.equals(xkgid3));
    Assert.assertFalse(xkgid3.equals(kgid2));

    Assert.assertTrue(xkgid1.equals(xkgid3));
    Assert.assertTrue(xkgid3.equals(xkgid1))
  }
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOKeyGlobalID

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.