Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOEditingContext.insertObject()


            if(stringValue.charAt(0) == '@') { // computed key
                if(stringValue.equals("@new")) {
                    EOClassDescription cd = EOClassDescription.classDescriptionForEntityName(relationshipEntityName);
                    EOEnterpriseObject newObject = cd.createInstanceWithEditingContext(eo.editingContext(), null);
                    ec.insertObject(newObject);
                    eo.addObjectToBothSidesOfRelationshipWithKey(newObject,key);
                } else if(stringValue.startsWith("@threadStorage.")) {
                    String keyPath = stringValue.substring("@threadStorage.".length());
                    Object o = ERXThreadStorage.valueForKey(keyPath);
                    if(keyPath.indexOf(".") > 0) {
View Full Code Here


      throw new IllegalArgumentException("There was no editing context attached to this rest context.");
    }
    editingContext.lock();
    try {
      EOEnterpriseObject eo = entity.createInstanceWithEditingContext(editingContext, null);
      editingContext.insertObject(eo);
      return eo;
    }
    finally {
      editingContext.unlock();
    }
View Full Code Here

        }
        EOClassDescription aClassDescription = EOClassDescription.classDescriptionForEntityName("FSDirectory");
        EOEnterpriseObject anObject = aClassDescription.createInstanceWithEditingContext(anEditingContext, null);
        anObject.takeValueForKey((System.getProperty("user.home") + File.separator + "FSItemInsertTest"), "absolutePath");

        anEditingContext.insertObject(anObject);
        anEditingContext.saveChanges();

        anEditingContext.deleteObject(anObject);
        anEditingContext.saveChanges();
    }
View Full Code Here

    // create new objects and insert them into editing context
    EOEditingContext editingContext = editingContext();
    // generate fee and rental and insert it into editing context
    Fee fee = new Fee();
    Rental rental = new Rental();
    editingContext.insertObject(fee);
    editingContext.insertObject(rental);
    // manipulate relationships after inserting objects
    rental.addObjectToBothSidesOfRelationshipWithKey(unit, Rental.UnitKey);
    rental.addObjectToBothSidesOfRelationshipWithKey(fee, Rental.FeesKey);
    addObjectToBothSidesOfRelationshipWithKey(rental, RentalsKey);
View Full Code Here

    EOEditingContext editingContext = editingContext();
    // generate fee and rental and insert it into editing context
    Fee fee = new Fee();
    Rental rental = new Rental();
    editingContext.insertObject(fee);
    editingContext.insertObject(rental);
    // manipulate relationships after inserting objects
    rental.addObjectToBothSidesOfRelationshipWithKey(unit, Rental.UnitKey);
    rental.addObjectToBothSidesOfRelationshipWithKey(fee, Rental.FeesKey);
    addObjectToBothSidesOfRelationshipWithKey(rental, RentalsKey);
  }
View Full Code Here

      feePaid();
    } else {
      EOEditingContext editingContext = editingContext();
      // generate late fee and insert it into editing context
      Fee fee = new Fee(dateDue(), editingContext);
      editingContext.insertObject(fee);
      // manipulate relationship after inserting object
      addObjectToBothSidesOfRelationshipWithKey(fee, FeesKey);
    }
  }
}
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.