Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOGlobalID


   * Posts the notification JOB_WILL_RUN and a userInfo with a global ID if the key is ERQSJob.ENTERPRISE_OBJECT_KEY
   * or directly the ERQSJobDescription object with the key ERQSJob.NOT_PERSISTENT_OBJECT_KEY
   */
  public void jobToBeExecuted(final JobExecutionContext jobexecutioncontext)
  {
    EOGlobalID id = null;
    ERQSJobDescription aJobDescription = null;
    try
    {
      NSDictionary<String, Object> userInfo = null;

View Full Code Here


        updateJobDescription(jobexecutioncontext, aJobDescription);
      }

      if (aJobDescription == null)
      {
        EOGlobalID id = (EOGlobalID) jobexecutioncontext.getMergedJobDataMap().get(ERQSJob.ENTERPRISE_OBJECT_KEY);

        // We save in database if there is no exception.
        if (id != null && jobexecutionexception == null)
        {
          userInfo.setObjectForKey(id, ERQSJob.ENTERPRISE_OBJECT_KEY);
View Full Code Here

        EOEntity entity = EOUtilities.entityNamed(this, anObject.entityName());
        NSArray primaryKeyAttributes = entity.primaryKeyAttributes();
        if (primaryKeyAttributes.count() != 1)
            throw new IllegalArgumentException(entity.name() + " has a compound primary key and can't be used with insertSavedObject().");
        NSDictionary primaryKeyDictionary = new NSDictionary(fakePrimaryKeyCounter++, ((EOAttribute)primaryKeyAttributes.objectAtIndex(0)).name());
        EOGlobalID globalID = entity.globalIDForRow(primaryKeyDictionary);
        anObject.__setGlobalID(globalID);
        return globalID;
    }
View Full Code Here

      hashCode = 0;
    }
    else if (eoSupport(component) && object instanceof EOEnterpriseObject) {
      EOEnterpriseObject eo = (EOEnterpriseObject)object;
      EOEditingContext editingContext = eo.editingContext();
      EOGlobalID gid = null;
      if (editingContext != null) {
        gid = editingContext.globalIDForObject(eo);
      }
      // If the EO isn't in an EC, or it has a null GID, then just fall back to the hash code
      if (gid == null) {
        hashCode = System.identityHashCode(object);
      }
      else {
        hashCode = gid.hashCode();
      }
    }
    else {
      hashCode = System.identityHashCode(object);
    }
View Full Code Here

   */

  private synchronized boolean batchFetchToOneFault(EODatabaseContext dbc, AutoBatchFaultingEnterpriseObject eo) {
    if(fetchingToOne.canEnter(dbc)) {
      try {
        EOGlobalID sourceGID = eo.batchFaultingSourceGlobalID();
        String key = eo.batchFaultingRelationshipName();
        if(sourceGID != null && key != null) {
          EOEditingContext ec = eo.editingContext();
          AutoBatchFaultingEnterpriseObject source = (AutoBatchFaultingEnterpriseObject) ec.faultForGlobalID(sourceGID, ec);
          EOEntityClassDescription cd = (EOEntityClassDescription)source.classDescription();
View Full Code Here

    Assert.assertTrue(xkgid3.equals(xkgid1))
  }

  public void testGlobalIDForGID() {

    EOGlobalID gid = ec.globalIDForObject(co);

    ERXKeyGlobalID xkgid1 = ERXKeyGlobalID.globalIDForGID((EOKeyGlobalID)gid);
    Assert.assertEquals(gid, xkgid1.globalID());
  }
View Full Code Here

  }

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

    EOGlobalID gid = ec.globalIDForObject(co);

    int pk = ERXTestUtilities.pkOne(ec, co);

    ERXKeyGlobalID xkgid1 = new ERXKeyGlobalID(Company.ENTITY_NAME, new Integer[] { pk });
    Assert.assertEquals(gid, xkgid1.globalID());
View Full Code Here

   */
  public static NSArray snapshotArrayForRelationshipInObject(EOEnterpriseObject object, final String relationshipName) {
      final EOEditingContext ec = object.editingContext();
      EOEntity entity = EOUtilities.entityForObject(ec, object);

        final EOGlobalID gid = ec.globalIDForObject(object);
        String modelName = entity.model().name();
        final EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, modelName);

        NSArray toManySnapshot = ERXEOAccessUtilities.executeDatabaseContextOperation(dbc, 2,
                new DatabaseContextOperation<NSArray>() {
View Full Code Here

     */
    public static NSDictionary snapshotForObject(EOEnterpriseObject object) {
        final EOEditingContext ec = object.editingContext();
        EOEntity entity = EOUtilities.entityForObject(ec, object);

        final EOGlobalID gid = ec.globalIDForObject(object);
        String modelName = entity.model().name();
        final EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, modelName);

        NSDictionary snapshot = ERXEOAccessUtilities.executeDatabaseContextOperation(dbc, 2,
                new DatabaseContextOperation<NSDictionary>() {
View Full Code Here

  /**
   * Test case where
   * <li> the relationship is not a fault.
   */
  public void testObjectCountForToManyRelationship_NoFault() {
    EOGlobalID cGid = ERXTestUtilities.createCompanyAnd3Employees();
   
    EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {
      Company c = (Company) ec.faultForGlobalID(cGid, ec);
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOGlobalID

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.