Examples of EOGlobalID


Examples of com.webobjects.eocontrol.EOGlobalID

    @SuppressWarnings("unchecked")
    public static EOGlobalID globalIDForString(EOEditingContext ec, String entityName, String string) {
      NSDictionary<String, Object> values = primaryKeyDictionaryForString(ec, entityName, string);
      EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
        NSArray<String> pks = entity.primaryKeyAttributeNames();
        EOGlobalID gid = EOKeyGlobalID.globalIDWithEntityName(entityName, values.objectsForKeys(pks, null).objects());
      return gid;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

        EOEditingContext ec = obj.editingContext();
        if (ec == null) {
            //you don't have an EC! Bad EO. We can do nothing.
            return null;
        }
        EOGlobalID gid = ec.globalIDForObject(obj);
        if (gid.isTemporary()) {
            //no pk yet assigned
            return null;
        }
        EOKeyGlobalID kGid = (EOKeyGlobalID) gid;
        return kGid.keyValuesArray();
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

        int c = eos != null ? eos.count() : 0;
        NSMutableArray ids = new NSMutableArray(c);
        for (int i = 0; i < c; i++) {
            EOEnterpriseObject eo = (EOEnterpriseObject)eos.objectAtIndex(i);
            EOEditingContext ec = eo.editingContext();
            EOGlobalID gid = ec.globalIDForObject(eo);
            ids.addObject(gid);
        }
        return ids;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

        if ( globalIDs != null && globalIDs.count() > 0 ) {
            final NSMutableArray a = new NSMutableArray();
            final Enumeration e = globalIDs.objectEnumerator();
           
            while ( e.hasMoreElements() ) {
                final EOGlobalID theGID = (EOGlobalID)e.nextElement();
                final EOEnterpriseObject theObject = ec.faultForGlobalID(theGID, ec);
               
                if ( theObject != null )
                    a.addObject(theObject);
            }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

     */
    public static NSArray faultsForGlobalIDs(EOEditingContext ec, NSArray gids) {
        int c = gids.count();
        NSMutableArray a = new NSMutableArray(c);
        for (int i = 0; i < c; i++) {
            EOGlobalID gid = (EOGlobalID)gids.objectAtIndex(i);
            EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
            a.addObject(eo);
        }
        return a;
   
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

     *    new object.
     */
    public static boolean isNewObject(EOEnterpriseObject eo) {
        if (eo.editingContext() == null) return true;
       
        EOGlobalID gid = eo.editingContext().globalIDForObject(eo);
        return gid.isTemporary();
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

   * @since Apr 25, 2014
   */
  public static ERAttachment fetchAttachmentFor(final EOEditingContext editingContext, final Integer attachmentPrimaryKey, final String requestedWebPath) {
    ERAttachment attachment;
    if (attachmentPrimaryKey != null) {
      final EOGlobalID gid = EOKeyGlobalID.globalIDWithEntityName(ERAttachment.ENTITY_NAME, new Object[] {(attachmentPrimaryKey)});
      attachment = (ERAttachment) ERXEOGlobalIDUtilities.fetchObjectWithGlobalID(editingContext, gid);

      /*
       * Ensure the attachment request is a legitimate one by comparing the attachment's webPath to the
       * requestedWebPath.
 
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

        EOEditingContext editingContext = attachment.editingContext();

        editingContext.lock();

        try {
            EOGlobalID attachmentID = editingContext.globalIDForObject(attachment);
            ERAttachmentQueueEntry<T> entry = new ERAttachmentQueueEntry<T>(attachment._pendingUploadFile(), attachmentID);

            enqueue(entry);
        } finally {
            editingContext.unlock();
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

        super.init(ec);
        setIsDeleted(false);
    }

    public void setObject(EOEnterpriseObject eo) {
        EOGlobalID gid;
        if (gid() == null) {
            if (eo instanceof ERXGenericRecord) {
                gid = ((ERXGenericRecord) eo).permanentGlobalID();
            } else {
                throw new IllegalArgumentException("Can't handle non ERXGenericRecord");
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

          level++;
        }
      }
      result.removeAllObjects();
      for (Enumeration e = _cachedComponents.objectEnumerator(); e.hasMoreElements();) {
        EOGlobalID gid = (EOGlobalID) e.nextElement();
        Component component = (Component) ec.faultForGlobalID(gid, ec);
        if(component != null) {
          result.addObject(component);
        } else {
          log.error("No object: " + gid);
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.