Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EORelationship.addJoin()


            relationship.setName(targetName+(isToMany ? "s" : ""));
            selectedEntity.addRelationship(relationship);

           
            EOJoin join = new EOJoin(selectedPK, foreignAttribute);
            relationship.addJoin(join);
            relationship.setToMany(isToMany);
            relationship.setJoinSemantic(EORelationship.InnerJoin);
           
            if(addBack) {
                relationship = new EORelationship();
View Full Code Here


            if(addBack) {
                relationship = new EORelationship();
                join = new EOJoin(foreignAttribute,selectedPK);
                relationship.setName(selectedName);
                targetEntity.addRelationship(relationship);
                relationship.addJoin(join);
                relationship.setToMany(false);
                relationship.setJoinSemantic(EORelationship.InnerJoin);
            }
        }
        public void addBackRelationship(EOEntity selectedEntity, EOEntity targetEntity, EOAttribute foreignAttribute, boolean isToMany, boolean addBack) {
View Full Code Here

            }
            relationship.setName(targetName+(isToMany ? "s" : ""));
            selectedEntity.addRelationship(relationship);

            EOJoin join = new EOJoin(foreignAttribute,selectedPK);
            relationship.addJoin(join);
            relationship.setToMany(isToMany);
            relationship.setJoinSemantic(EORelationship.InnerJoin);
        }
        public void addRelationship(EOAttribute foreignAttribute, boolean isToMany, boolean addBack) {
            addRelationship(selectedEntity, targetEntity, foreignAttribute, isToMany, addBack);
View Full Code Here

    EOJoin join = new EOJoin(sourceAttribute, destinationAttribute);
    EORelationship relationship = new EORelationship();

    relationship.setName(relationshipName);
    sourceEntity.addRelationship(relationship);
    relationship.addJoin(join);
    relationship.setToMany(toMany);
    relationship.setJoinSemantic(EORelationship.InnerJoin);
    relationship.setDeleteRule(deleteRule);
    relationship.setIsMandatory(isMandatory);
    relationship.setPropagatesPrimaryKey(shouldPropagatePrimaryKey);
View Full Code Here

        itemFKAttribute.setScale(itemPrimaryKey.scale());
        itemFKAttribute.setAllowsNull(false);
        joinEntity.addAttribute(itemFKAttribute);

        EOJoin join = new EOJoin(itemFKAttribute, itemPrimaryKey);
        joinToItemRelationship.addJoin(join);
      }

      EORelationship joinToTagRelationship = new EORelationship();
      joinToTagRelationship.setName(tagEntity.name());
      joinToTagRelationship.setIsMandatory(true);
View Full Code Here

        tagFKAttribute.setPrecision(tagPrimaryKey.precision());
        tagFKAttribute.setScale(tagPrimaryKey.scale());
        tagFKAttribute.setAllowsNull(false);
        joinEntity.addAttribute(tagFKAttribute);

        joinToTagRelationship.addJoin(new EOJoin(tagFKAttribute, tagPrimaryKey));
      }

      joinEntity.setPrimaryKeyAttributes(joinEntity.attributes());
      joinEntity.setAttributesUsedForLocking(joinEntity.attributes());
      entity.model().addEntity(joinEntity);
View Full Code Here

      itemToJoinRelationship.setName("_eofInv_" + joinToItemRelationship.entity().name() + "_" + joinToItemRelationship.name());
      NSArray<EOJoin> joinToItemRelationshipJoins = joinToItemRelationship.joins();
      for (int joinNum = joinToItemRelationshipJoins.count() - 1; joinNum >= 0; joinNum--) {
        EOJoin join = joinToItemRelationshipJoins.objectAtIndex(joinNum);
        EOJoin inverseJoin = new EOJoin(join.destinationAttribute(), join.sourceAttribute());
        itemToJoinRelationship.addJoin(inverseJoin);
      }
      itemToJoinRelationship.setDeleteRule(1); // cascade
      itemToJoinRelationship.setJoinSemantic(EORelationship.InnerJoin);
      itemToJoinRelationship.setToMany(true);
      itemToJoinRelationship.setPropagatesPrimaryKey(true);
View Full Code Here

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

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

       
        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);
        userRelationship.setJoinSemantic(EORelationship.InnerJoin);
    }

    /**
 
View Full Code Here

    relationship.setName(sourceAttributes.objectAtIndex(0).name() + "_" + destinationAttributes.objectAtIndex(0).name());
    relationship.setEntity(sourceEntity);
   
    for (int attributeNum = 0; attributeNum < sourceAttributes.count(); attributeNum ++) {
      EOJoin join = new EOJoin(sourceAttributes.objectAtIndex(attributeNum), destinationAttributes.objectAtIndex(attributeNum));
      relationship.addJoin(join);
    }
   
    return relationship;
  }
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.