|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jdo.impl.model.jdo.JDOElementImpl
org.apache.jdo.impl.model.jdo.JDORelationshipImpl
JDORelationship is the super interface for all interfaces representing JDO relationship metadata of a managed field of a persistence capable class.
| Field Summary | |
private JDOField |
declaringField
Relationship JDOField<->JDORelationship. |
protected JDORelationship |
inverse
Relationship JDORelationship<->JDORelationship. |
private java.lang.String |
inverseName
Name of the field which is the inverse relationship |
private int |
lowerBound
Property lowerBound. |
protected JDORelationship |
mappedBy
Relationship JDORelationship<->JDORelationship. |
private int |
upperBound
Property upperBound. |
| Fields inherited from class org.apache.jdo.impl.model.jdo.JDOElementImpl |
|
| Fields inherited from interface org.apache.jdo.model.jdo.JDORelationship |
CARDINALITY_N, CARDINALITY_ONE, CARDINALITY_ZERO |
| Constructor Summary | |
JDORelationshipImpl()
|
|
| Method Summary | |
private void |
changeInverseRelationship(JDORelationship inverseRelationship)
Changes the inverse relationship element for this relationship element. |
JDOField |
getDeclaringField()
Get the declaring field of this JDORelationship. |
JDORelationship |
getInverseRelationship()
Get the inverse JDORelationship in the case of a two-way relationship. |
java.lang.String |
getInverseRelationshipName()
Get the relative name of the inverse relationship field for this relationship. |
int |
getLowerBound()
Get the lower cardinality bound for this relationship element. |
JDORelationship |
getMappedBy()
Get the mappedBy relationship. |
abstract JavaType |
getRelatedJavaType()
Get the type representation of the relationship. |
JDOClass |
getRelatedJDOClass()
Get the JDOClass corresponding to the type or element of this relationship. |
private UnresolvedRelationshipHelper |
getUnresolvedRelationshipHelper()
Returns the UnresolvedRelationshipHelper instance from the declaring field. |
int |
getUpperBound()
Get the upper cardinality bound for this relationship element. |
boolean |
isJDOArray()
Determines whether this JDORelationship represents an array relationship or not. |
boolean |
isJDOCollection()
Determines whether this JDORelationship represents a collection relationship or not. |
boolean |
isJDOMap()
Determines whether this JDORelationship represents a map relationship or not. |
boolean |
isJDOReference()
Determines whether this JDORelationship represents a reference relationship or not. |
boolean |
isOwner()
Determines whether this side of a two-way relationship is the owning side. |
void |
setDeclaringField(JDOField declaringField)
Set the declaring field of this JDORelationship. |
void |
setInverseRelationship(JDORelationship inverseRelationship)
Set the inverse JDORelationship in the case of a two-way relationship. |
void |
setLowerBound(int lowerBound)
Set the lower cardinality bound for this relationship element. |
void |
setMappedBy(JDORelationship mappedBy)
Set the mappedBy relationship for this relationship. |
void |
setUpperBound(int upperBound)
Set the upper cardinality bound for this relationship element. |
| Methods inherited from class org.apache.jdo.impl.model.jdo.JDOElementImpl |
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, firePropertyChange, fireVetoableChange, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.jdo.model.jdo.JDOElement |
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener |
| Field Detail |
private int lowerBound
private int upperBound
private JDOField declaringField
protected JDORelationship mappedBy
private java.lang.String inverseName
protected JDORelationship inverse
| Constructor Detail |
public JDORelationshipImpl()
| Method Detail |
public int getLowerBound()
getLowerBound in interface JDORelationshippublic void setLowerBound(int lowerBound)
setLowerBound in interface JDORelationshiplowerBound - an integer indicating the lower cardinality boundpublic int getUpperBound()
getUpperBound in interface JDORelationshippublic void setUpperBound(int upperBound)
setUpperBound in interface JDORelationshipupperBound - an integer indicating the upper cardinality boundpublic JDOField getDeclaringField()
getDeclaringField in interface JDORelationshipnull
if the element is not attached to any fieldpublic void setDeclaringField(JDOField declaringField)
setDeclaringField in interface JDORelationshipdeclaringField - the declaring field of this relationship elementpublic JDOClass getRelatedJDOClass()
getRelatedJDOClass in interface JDORelationshippublic JDORelationship getMappedBy()
null if there is no mappedBy relationship set and there
is no mappedBy name specified on the declaring field.
getMappedBy in interface JDORelationshipnull
otherwise.
public void setMappedBy(JDORelationship mappedBy)
throws ModelException
setMappedBy in interface JDORelationshipmappedBy - the mappedBy relationship.
ModelException - if impossiblepublic java.lang.String getInverseRelationshipName()
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.
getInverseRelationshipName in interface JDORelationshipgetInverseRelationship()public JDORelationship getInverseRelationship()
getInverseRelationship in interface JDORelationship
public void setInverseRelationship(JDORelationship inverseRelationship)
throws ModelException
Warning: this methods casts the existing and the specified inverse relationship instance to JDORelationshipImpl.
setInverseRelationship in interface JDORelationshipinverseRelationship - the inverse relationship
ModelException - if impossiblepublic boolean isOwner()
isOwner in interface JDORelationshiptrue if this side is the owning side;
false otherwise.public boolean isJDOReference()
true means this
JDORelationship is a JDOReference instance.
isJDOReference in interface JDORelationshiptrue if this JDORelationship represents a
reference relationship; false otherwise.public boolean isJDOCollection()
true means this
JDORelationship is a JDOCollection instance.
isJDOCollection in interface JDORelationshiptrue if this JDORelationship represents a
collection relationship; false otherwise.public boolean isJDOArray()
true means this
JDORelationship is a JDOArray instance.
isJDOArray in interface JDORelationshiptrue if this JDORelationship represents an
array relationship; false otherwise.public boolean isJDOMap()
true means this
JDORelationship is a JDOMap instance.
isJDOMap in interface JDORelationshiptrue if this JDORelationship represents a
map relationship; false otherwise.public abstract JavaType getRelatedJavaType()
private void changeInverseRelationship(JDORelationship inverseRelationship)
throws ModelException
setInverseRelationship(org.apache.jdo.model.jdo.JDORelationship) and should handle setting the
internal variable.
inverseRelationship - - a relationship element to be used as the
inverse for this relationship element or null if this
relationship element does not participate in a two-way relationship.
ModelException - if impossibleprivate UnresolvedRelationshipHelper getUnresolvedRelationshipHelper()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||