Save This Page
Home » jdo2-model-2.3-ea-src » org.apache.jdo.model.jdo » [javadoc | source]
org.apache.jdo.model.jdo
public interface: JDORelationship [javadoc | source]

All Implemented Interfaces:
    JDOElement

All Known Implementing Classes:
    JDOMapImplCaching, JDOArrayImplDynamic, JDOArrayImplCaching, JDOCollection, JDOArray, JDOMap, JDORelationshipImpl, JDOReference, JDOCollectionImplDynamic, JDOMapImplDynamic, JDOReferenceImplDynamic, JDOReferenceImplCaching, JDOCollectionImplCaching

JDORelationship is the super interface for all interfaces representing JDO relationship metadata of a managed field of a persistence-capable class.
Field Summary
public static final  int CARDINALITY_ZERO    Constant representing the cardinality zero used for lower and upper bounds. 
public static final  int CARDINALITY_ONE    Constant representing the cardinality one used for lower and upper bounds. 
public static final  int CARDINALITY_N    Constant representing the cardinality n used for lower and upper bounds. 
Method from org.apache.jdo.model.jdo.JDORelationship Summary:
getDeclaringField,   getInverseRelationship,   getInverseRelationshipName,   getLowerBound,   getMappedBy,   getRelatedJDOClass,   getUpperBound,   isJDOArray,   isJDOCollection,   isJDOMap,   isJDOReference,   isOwner,   setDeclaringField,   setInverseRelationship,   setLowerBound,   setMappedBy,   setUpperBound
Method from org.apache.jdo.model.jdo.JDORelationship Detail:
 public JDOField getDeclaringField()
    Get the declaring field of this JDORelationship.
 public JDORelationship getInverseRelationship()
    Get the inverse JDORelationship in the case of a two-way relationship.
 public String getInverseRelationshipName()
    Get the relative name of the inverse relationship field for this relationship. In the case of two-way relationships, the two relationships involved are inverses of each other. If this relationship element does not participate in a two-way relationship, this returns null. Note that it is possible to have this method return a value, but because of the combination of related class and lookup, there may be no corresponding JDORelationship which can be found.
 public int getLowerBound()
    Get the lower cardinality bound for this relationship element.
 public JDORelationship getMappedBy()
    Get the mappedBy relationship. If there is no mappedBy relationship set, the method checks the mappedBy name as specified in the declaring field and resolves the relationship. The method return null if there is no mappedBy relationship set and there is no mappedBy name specified on the declaring field.
 public JDOClass getRelatedJDOClass()
    Get the JDOClass corresponding to the type or element of this relationship.
 public int getUpperBound()
    Get the upper cardinality bound for this relationship element.
 public boolean isJDOArray()
    Determines whether this JDORelationship represents an array relationship or not. A return of true means this JDORelationship is a JDOArray instance.
 public boolean isJDOCollection()
    Determines whether this JDORelationship represents a collection relationship or not. A return of true means this JDORelationship is a JDOCollection instance.
 public boolean isJDOMap()
    Determines whether this JDORelationship represents a map relationship or not. A return of true means this JDORelationship is a JDOMap instance.
 public boolean isJDOReference()
    Determines whether this JDORelationship represents a reference relationship or not. A return of true means this JDORelationship is a JDOReference instance.
 public boolean isOwner()
    Determines whether this side of a two-way relationship is the owning side.
 public  void setDeclaringField(JDOField declaringField) throws ModelException
    Set the declaring field of this JDORelationship.
 public  void setInverseRelationship(JDORelationship inverseRelationship) throws ModelExceptionDeprecated! - -  call setMappedBy instead

    Set the inverse JDORelationship in the case of a two-way relationship. The two relationship elements involved are set as inverses of each other and the old inverse is unset.
 public  void setLowerBound(int lowerBound) throws ModelException
    Set the lower cardinality bound for this relationship element.
 public  void setMappedBy(JDORelationship mappedBy) throws ModelException
    Set the mappedBy relationship for this relationship. This method automatically updates the mappedBy name of the declaring field of this relationship.
 public  void setUpperBound(int upperBound) throws ModelException
    Set the upper cardinality bound for this relationship element.