Examples of EOGlobalID


Examples of com.webobjects.eocontrol.EOGlobalID

          anEntityName);
      EORelationship aRelationship = anEntity.relationshipNamed(aKey);

      if (aRelationship != null) {
        EOEditingContext anEditingContext = editingContext();
        EOGlobalID aGlobalID = anEditingContext.globalIDForObject(this);
        String aModelName = anEntity.model().name();
        EODatabaseContext aDatabaseContext = EOUtilities
            .databaseContextForModelNamed(anEditingContext,
                aModelName);
        aDatabaseContext.lock();
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

      super.awakeFromInsertion(editingContext);
    }
    finally {
      _setUpdateInverseRelationships(old);
    }
    EOGlobalID gid = editingContext.globalIDForObject(this);
    if (gid.isTemporary()) {
      init(editingContext);
      if (applyRestrictingQualifierOnInsert()) {
        EOEntity entity = ERXEOAccessUtilities.entityNamed(editingContext, entityName());
        EOQualifier restrictingQualifier = entity.restrictingQualifier();
        if (restrictingQualifier != null) {
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

  public EOKeyGlobalID permanentGlobalID(boolean generateIfMissing) {
    if (_permanentGlobalID == null) {
      final EOEditingContext ec = editingContext();

      if (ec != null) {
        final EOGlobalID gid = ec.globalIDForObject(this);

        if (!gid.isTemporary()) {
          _permanentGlobalID = (EOKeyGlobalID) gid;
        }
        else if (generateIfMissing) {
          final NSDictionary<String, Object> primaryKeyDictionary = primaryKeyDictionary(false);
          final Object[] values;
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

  public boolean isDeletedEO() {
    if (log.isDebugEnabled()) {
      log.debug("editingContext() = " + editingContext() + " this object: " + this);
    }
    // HACK AK: using private API here
    EOGlobalID gid = __globalID();
    boolean isDeleted = (editingContext() == null && (gid != null && !gid.isTemporary()));
    return isDeleted || (editingContext() != null && editingContext().deletedObjects().containsObject(this));
  }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

     * @param eo eo the object to add to the cache
     * @param key the key to add the object under
     */
    public void addObjectForKey(T eo, Object key) {
      if (qualifier() == null || qualifier().evaluateWithObject(eo)) {
          EOGlobalID gid = NO_GID_MARKER;
          if(eo != null) {
              gid = eo.editingContext().globalIDForObject(eo);
          }
          cache().setObjectForKey(createRecord(gid, eo), key);
      }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

     * is removed from the cache if it does not match the qualifier.
     * @param eo eo the object to update in the cache
     * @param key the key of the object to update
     */
    public void updateObjectForKey(T eo, Object key) {
        EOGlobalID gid = NO_GID_MARKER;
        if(eo != null) {
            gid = eo.editingContext().globalIDForObject(eo);
        }
        ERXExpiringCache<Object, EORecord<T>> cache = cache();
        synchronized (cache) {
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

        if (parts.length > 2) {
          type = parts[2];
          pk = parts[3];
        }
        EOEnterpriseObject eo;
        EOGlobalID gid;
        if(pk != null && pk.length() > 0) {
          if ("T".equals(type)) {
            byte[] bytes = ERXStringUtilities.hexStringToByteArray(pk);
            gid = EOTemporaryGlobalID._gidForRawBytes(bytes);
            eo = ec.objectForGlobalID(gid);
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

      EOEditingContext ec = eo.editingContext();
      String ecid = registerEditingContext(ec);
      String type;
      String pkStr;
      EOGlobalID gid = ec.globalIDForObject(eo);
      if (gid instanceof EOTemporaryGlobalID) {
        type = "T";
        byte[] bytes = ((EOTemporaryGlobalID)gid)._rawBytes();
        pkStr = ERXStringUtilities.byteArrayToHexString(bytes);
      }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

      WeakReference<T> ref = _refs[index];
      if(ref != null) {
        result = ref.get();
      }
      if(result == null) {
        EOGlobalID gid = _array[index];
        result = (T)editingContext().objectForGlobalID(gid);
        if(result == null) {
          result = (T)editingContext().faultForGlobalID(gid, editingContext());
          // System.out.println("fault: " + result.isFault());
        } else {
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

 
  @Override
  public boolean containsObject(Object object) {
    if (object instanceof EOEnterpriseObject) {
      EOEnterpriseObject eo = (EOEnterpriseObject) object;
      EOGlobalID gid = editingContext().globalIDForObject(eo);
      for (int i = 0; i < count(); i++) {
        EOGlobalID current = _array[i];
        if(current.equals(gid)) {
          return true;
        }
      }
      return false;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.