Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOEnterpriseObject.editingContext()


    */
   public static Object convertEOtoGID(Object obj) {
     Object result;
     if (obj instanceof EOEnterpriseObject) {
       EOEnterpriseObject eoful = (EOEnterpriseObject)obj;
       EOGlobalID gidful = eoful.editingContext().globalIDForObject(eoful);
       result = gidful;
     }
     else if (obj instanceof IERXEOContainer) {
       result = ((IERXEOContainer)obj).toGIDContainer();
     }
View Full Code Here


    public static NSArray snapshotsForObjectsFromRelationshipNamed(NSArray eos, String relKey) {
      NSMutableArray result = new NSMutableArray();
      if (eos.count() > 0) {
        EOEnterpriseObject eo = (EOEnterpriseObject)eos.lastObject();
        String entityName = eo.entityName();
        EOEditingContext ec = eo.editingContext();
        EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
        EORelationship relationship = entity.relationshipNamed(relKey);
        if(relationship.sourceAttributes().count() == 1) {
          EOAttribute attribute = relationship.sourceAttributes().lastObject();
          EODatabaseContext context = EOUtilities.databaseContextForModelNamed(ec, entity.model().name());
View Full Code Here

     *    into
     * @return actor instance in the given editing context
     */
    public static EOEnterpriseObject actor(EOEditingContext ec) {
        EOEnterpriseObject actor = actor();
        if (actor != null && actor.editingContext() != ec) {
            EOEditingContext actorEc = actor.editingContext();
            actorEc.lock();
            try {
              EOEnterpriseObject localActor = ERXEOControlUtilities.localInstanceOfObject(ec, actor);
              try {
View Full Code Here

     * @return actor instance in the given editing context
     */
    public static EOEnterpriseObject actor(EOEditingContext ec) {
        EOEnterpriseObject actor = actor();
        if (actor != null && actor.editingContext() != ec) {
            EOEditingContext actorEc = actor.editingContext();
            actorEc.lock();
            try {
              EOEnterpriseObject localActor = ERXEOControlUtilities.localInstanceOfObject(ec, actor);
              try {
                if(actor instanceof ERCoreUserInterface) {
View Full Code Here

            Object object = realSourceObject();
            String key = realRelationshipKey();
            Object selection = NSKeyValueCoding.Utility.valueForKey(object,key);
            if (selection != null && selection instanceof EOEnterpriseObject) {
              EOEnterpriseObject eo = (EOEnterpriseObject)selection;
              if (eo.editingContext() != editingContext()) {
                selection = ERXEOControlUtilities.localInstanceOfObject(editingContext(), eo);
              }
            }

            setSelection(selection);
View Full Code Here

        private void traverseForHomogeniousObjects(NSArray sourceObjects, boolean skipFaultedSourceObjects) {
            if (sourceObjects == null || sourceObjects.count() < 1) return;

            EOEnterpriseObject eo = (EOEnterpriseObject) sourceObjects.objectAtIndex(0);
            EOEditingContext ec = eo.editingContext();
            EOEntity entity = EOUtilities.entityForObject(ec, eo);

            EORelationship relationship = entity.relationshipNamed(path);

            if (relationship == null) return;
View Full Code Here

        }

        private void batchFetchRelationshipOnSourceObjects(EORelationship relationship, NSArray sourceObjects, boolean skipFaultedSourceObjects) {

            EOEnterpriseObject eo = (EOEnterpriseObject) sourceObjects.objectAtIndex(0);
            EOEditingContext ec = eo.editingContext();

            if (log.isDebugEnabled()) {
              log.debug("Batch fetching '" + path + "' relationship on " + sourceObjects);
            }
View Full Code Here

    public boolean evaluateWithObject(Object object) {
        Object value = null;
        String key = key();
        if(object instanceof EOEnterpriseObject) {
            EOEnterpriseObject eo = (EOEnterpriseObject)object;
            EOEditingContext ec = eo.editingContext();
            EOClassDescription cd = eo.classDescription();
            if (cd.attributeKeys().containsObject(key)) {
                value = NSKeyValueCodingAdditions.Utility.valueForKeyPath(eo, key);
            } else if (cd.toOneRelationshipKeys().containsObject(key)) {
                value = eo.valueForKeyPath(key);
View Full Code Here

                        NSDictionary dict =  null;
                        String currentKey = (String) destinationAttibuteNames.objectAtIndex(j);
                        Object v;
                        if (o instanceof EOEnterpriseObject) {
                            EOEnterpriseObject eoenterpriseobject = (EOEnterpriseObject)o;
                            EOObjectStoreCoordinator osc = ((EOObjectStoreCoordinator)eoenterpriseobject.editingContext().rootObjectStore());
                            dict = osc.valuesForKeys(new NSArray(currentKey), eoenterpriseobject);
                            v = dict.objectForKey(currentKey);
                         } else {
                            v = o;
                         }
View Full Code Here

    @Override
    public boolean evaluateWithObject(Object object) {
        Object value = null;
        if(object instanceof EOEnterpriseObject) {
            EOEnterpriseObject eo = (EOEnterpriseObject)object;
            EOEditingContext ec = eo.editingContext();
            if(eo.classDescription().attributeKeys().containsObject(key())) {
                value = NSKeyValueCodingAdditions.Utility.valueForKeyPath(eo, key());
            } else if(EOUtilities.entityNamed(ec, eo.entityName()).primaryKeyAttributeNames().containsObject(key())) {
                // when object is an EO and key() is a cross-relationship keypath, we drop through to this case
                // and we'll fail.
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.