Examples of attributeNamed()


Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

    public Format valueFormatter() {
        Format f = null;
        EORelationship rel = (EORelationship) valueForKeyPath("d2wContext.smartRelationship");
        EOEntity destEnt = rel.destinationEntity();
        EOAttribute searchAttr = destEnt.attributeNamed(keyWhenRelationship());
        if(searchAttr != null) {
            String className = searchAttr.className();
            if(className.equals("java.lang.Number"))
                f = new NSNumberFormatter("0");
            if(className.equals("java.lang.BigDecimal"))
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

        String externalName = entity.externalName();
        if (externalName != null && parentEntity != null) {
          // If you have a parent entity and that parent entity shares your table name, then you're single table inheritance
          boolean singleTableInheritance = externalName.equals(parentEntity.externalName());
          if (singleTableInheritance) {
            EOAttribute parentAttribute = parentEntity.attributeNamed(attribute.name());
            if (parentAttribute == null) {
              // If this attribute is new in the subclass, you have to allow nulls
              shouldAllowNull = true;
            }
          }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

        int lastDotIdx = kp.lastIndexOf(".");
        if (lastDotIdx == -1) {
          attribute = entity().attributeNamed(kp);
        } else {
          EOEntity kpEntity = entityForKeyPath(kp);
          attribute = kpEntity.attributeNamed(kp.substring(lastDotIdx+1));
        }
        // AK: inet6 addresses get handed down as "xxx:xxx:...:xxx%y", not "xxx:xxx:...:xxx/y"
        // note that this might break if you hand over a host name that contains percent chars (not sure if possible)
      if(attribute != null && "inet".equals(attribute.externalType()) && v != null && v.toString().indexOf('%') > 0) {
        v = v.toString().replace('%', '/');
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

        EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
        if (entity == null) {
          throw new IllegalStateException("Unable find entity named: " + entityName);
        }

        EOAttribute attribute = entity.attributeNamed(attributeName);
        if (attribute == null) {
          throw new IllegalStateException("Unable find attribute named: " + attributeName + " for entity: " + entityName);
        }

        EOAttribute aggregate = new EOAttribute();
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

        NSArray keys = changedValues.allKeys();
        NSMutableSet relationships = new NSMutableSet();
       
        for (int i=0; i<keys.count(); i++) {
            String key = (String)keys.objectAtIndex(i);
            EOAttribute attrib = entity.attributeNamed(key);
            if (attrib != null) {
                Object val = changedValues.objectForKey(key);
                if(ERXValueUtilities.isNull(val)) {
                  val = null;
                }
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

                         EORelationship rel = entity.anyRelationshipNamed(part);
                         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.eoaccess.EOEntity.attributeNamed()

    EOEntity sourceEntity = EOModelGroup.defaultGroup().entityNamed(sourceEntityName);
    if(sourceEntity.isAbstractEntity())
      log.warn("If you programatically add relationships to an abstract entity, make sure you also add it to child entities");
    EOEntity destinationEntity = EOModelGroup.defaultGroup().entityNamed(destinationEntityName);
    EOAttribute sourceAttribute = sourceEntity.attributeNamed(sourceAttributeName);
    EOAttribute destinationAttribute = destinationEntity.attributeNamed(destinationAttributeName);
    EOJoin join = new EOJoin(sourceAttribute, destinationAttribute);
    EORelationship relationship = new EORelationship();

    relationship.setName(relationshipName);
    sourceEntity.addRelationship(relationship);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

     */
    public void addPreferenceRelationshipToActorEntity(String entityName, String attributeNameToJoin) {
        EOEntity actor = EOModelGroup.defaultGroup().entityNamed(entityName);
        EOEntity preference = EOModelGroup.defaultGroup().entityNamed("ERCPreference");

        EOJoin preferencesJoin = new EOJoin(actor.attributeNamed(attributeNameToJoin), preference.attributeNamed("userID"));
        EORelationship preferencesRelationship = new EORelationship();

        preferencesRelationship.setName("preferences");
        actor.addRelationship(preferencesRelationship);
        preferencesRelationship.addJoin(preferencesJoin);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

        preferencesRelationship.addJoin(preferencesJoin);
        preferencesRelationship.setToMany(true);
        preferencesRelationship.setJoinSemantic(EORelationship.InnerJoin);
        preferencesRelationship.setDeleteRule(EOEntityClassDescription.DeleteRuleCascade);
       
        EOJoin userJoin = new EOJoin(preference.attributeNamed("userID"), actor.attributeNamed(attributeNameToJoin) );
        EORelationship userRelationship = new EORelationship();
        userRelationship.setName("user");
        preference.addRelationship(userRelationship);
        userRelationship.addJoin(userJoin);
        userRelationship.setToMany(false);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.attributeNamed()

    // as this creates a
    //
    EODatabaseContext context = EODatabaseContext.registeredDatabaseContextForModel(entity.model(), EOObjectStoreCoordinator.defaultCoordinator());
    EOSQLExpressionFactory factory = context.database().adaptor().expressionFactory();

    NSArray subAttributes = destinationAttName != null ? new NSArray(entity.attributeNamed(destinationAttName)) : entity.primaryKeyAttributes();

    EOSQLExpression subExpression = factory.expressionForEntity(entity);

    // Arroz: Having this table identifier replacement causes serious
    // problems if you have more than a table being processed in the subquery. Disabling
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.