Examples of EOClassDescription


Examples of com.webobjects.eocontrol.EOClassDescription

  public boolean synchronizesVariablesWithBindings() {
    return false;
  }
 
  public String destinationEntityName() {
    EOClassDescription destinationClassDescription = object().classDescriptionForDestinationKey(key());
    String destinationEntityName = destinationClassDescription.entityName();
    return destinationEntityName;
  }
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

      NSLog.debug.appendln("attribute == null");
        } else if (attribute.name() == null) {
      NSLog.debug.appendln("attribute.name() == null, attribute = "+attribute);
        } else {
      //NSLog.debug.appendln("checking eo="+eoentity.name()+", attributename="+attribute.name());
      EOClassDescription eoclassdescription = EOClassDescription.classDescriptionForEntityName(eoentity.name());
      EOEnterpriseObject eoenterpriseobject = eoclassdescription.createInstanceWithEditingContext(null, null);
                        eoenterpriseobject.valueForKeyPath(attribute.name());
                       
        }
    } catch (com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException e1) {
        //NSLog.debug.appendln(e1);
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

   * Performs the newObjectAction. Creates a new object and sets the inline task
   * to 'create'
   */
  public WOComponent newObjectAction() {
    EOEditingContext newEc = ERXEC.newEditingContext(masterObject().editingContext());
    EOClassDescription relatedObjectClassDescription = masterObject().classDescriptionForDestinationKey(relationshipKey());
    EOEnterpriseObject relatedObject = EOUtilities.createAndInsertInstance(newEc, relatedObjectClassDescription.entityName());
    EOEnterpriseObject localObj = EOUtilities.localInstanceOfObject(relatedObject.editingContext(), masterObject());
    if (localObj instanceof ERXGenericRecord) {
      ((ERXGenericRecord)localObj).setValidatedWhenNested(false);
    }
    localObj.addObjectToBothSidesOfRelationshipWithKey(relatedObject, relationshipKey());
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

//    NSLog.out.appendln("***ERMDEditRelationship.key: " + key() +"***");
    return super.key();
  }

  public String destinationEntityName() {
    EOClassDescription relatedObjectClassDescription = object().classDescriptionForDestinationKey(key());
    String relationshipEntityName = relatedObjectClassDescription.entityName();
//    NSLog.out.appendln("***ERMDEditRelationship.destinationEntityName: "
//        + relationshipEntityName +"***");
    return relationshipEntityName;
  }
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

     *
     * @param eo the EOEnterpriseObject
     * @return the EOEntity from the EOEnterpriseObject
     */
    public static EOEntity entityForEo(EOEnterpriseObject eo) {
        EOClassDescription classDesc = eo.classDescription();
       
        if (classDesc instanceof EOEntityClassDescription)
            return ((EOEntityClassDescription)classDesc).entity();
        return null;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

                         entity = rel.destinationEntity();
                         prefix += part + ".";
                     }
                 }
                     if(entity.attributeNamed(attributeName) == null) {
                       EOClassDescription cd = entity.classDescriptionForInstances();
                         if(cd instanceof ERXEntityClassDescription) {
                           String localizedKey = ((ERXEntityClassDescription)cd).localizedKey(attributeName);
                           if(localizedKey != null) {
                                 item = new EOSortOrdering(prefix + localizedKey, item.selector());
                           }
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

    }

    public void testSetClassDescription() {

        EOEntity entity1 = EOModelGroup.defaultGroup().entityNamed("Company");
        EOClassDescription desc = entity1.classDescriptionForInstances();

        Assert.assertNotNull(desc);

        URL entityUrl = null;
        try {
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

        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);
            } 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.
                value = EOUtilities.primaryKeyForObject(ec,eo).objectForKey(key);
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

        if (key==null) // better to raise before calling super which will crash
            throw new RuntimeException("validateValueForKey called with null key on "+this);
        Object result=null;
        try {
            result=super.validateValueForKey(value,key);
            EOClassDescription cd = classDescription();
            if(cd instanceof ERXEntityClassDescription) {
                ((ERXEntityClassDescription)cd).validateObjectWithUserInfo(this, value, "validateForKey." + key, key);
            }
        } catch (ERXValidationException e) {
            throw e;
View Full Code Here

Examples of com.webobjects.eocontrol.EOClassDescription

     * @throws NSValidation.ValidationException if the object does not
     *      pass validation for saving to the database.
     */
    @Override
  public void validateForInsert() throws NSValidation.ValidationException {
        EOClassDescription cd = classDescription();
        if(cd instanceof ERXEntityClassDescription) {
            ((ERXEntityClassDescription)cd).validateObjectForInsert(this);
        }
        super.validateForInsert();
    }
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.