Methods Summary |
---|
public void | changeInverseRelationship(com.sun.jdo.api.persistence.model.jdo.RelationshipElement inverseRelationship)Changes the inverse relationship element for this relationship element.
This method is invoked for both sides from
{@link RelationshipElement#setInverseRelationship} and should handle the
vetoable change events, property change events, and setting the internal
variable.
getRelationshipImpl().changeInverseRelationship(inverseRelationship);
|
public java.lang.String | getCollectionClass()Get the collection class (for example Set, List, Vector, etc.)
for this relationship element.
return getRelationshipImpl().getCollectionClass();
|
public int | getDeleteAction()Get the delete action for this relationship element.
return getRelationshipImpl().getDeleteAction();
|
public java.lang.String | getElementClass()Get the element class for this relationship element. If primitive
types are supported, you can use
wrapperclass.TYPE.toString() to specify them.
return getRelationshipImpl().getElementClass();
|
public com.sun.jdo.api.persistence.model.jdo.RelationshipElement | getInverseRelationship(com.sun.jdo.api.persistence.model.Model model)Get the inverse relationship element for this relationship element.
In the case of two-way relationships, the two relationship elements
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 also possible for this method to
return null even if {@link #getInverseRelationshipName}
returns a value because the corresponding RelationshipElement cannot
be found using the combination of related class and lookup (model).
String inverseName = getInverseRelationshipName();
RelationshipElement inverse = null;
if ((model != null) && (inverseName != null))
{
String relatedClass = model.getRelatedClass(this);
if (relatedClass != null)
{
PersistenceClassElement relatedElement =
model.getPersistenceClass(relatedClass);
if (relatedElement != null)
inverse = relatedElement.getRelationship(inverseName);
}
}
return inverse;
|
public java.lang.String | getInverseRelationshipName()Get the relative name of the inverse relationship field for this
relationship element. In the case of two-way relationships, the two
relationship elements 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 RelationshipElement which can
be found.
return getRelationshipImpl().getInverseRelationshipName();
|
public int | getLowerBound()Get the lower cardinality bound for this relationship element.
return getRelationshipImpl().getLowerBound();
|
final com.sun.jdo.api.persistence.model.jdo.RelationshipElement$Impl | getRelationshipImpl() return (Impl)getImpl();
|
public int | getUpdateAction()Get the update action for this relationship element.
return getRelationshipImpl().getUpdateAction();
|
public int | getUpperBound()Get the upper cardinality bound for this relationship element. Returns
{@link java.lang.Integer#MAX_VALUE} for n
return getRelationshipImpl().getUpperBound();
|
public boolean | isPrefetch()Determines whether this relationship element should prefetch or not.
return getRelationshipImpl().isPrefetch();
|
public void | setCollectionClass(java.lang.String collectionClass)Set the collection class for this relationship element.
getRelationshipImpl().setCollectionClass(collectionClass);
|
public void | setDeleteAction(int action)Set the delete action for this relationship element.
if ((action < NONE_ACTION) || (action > AGGREGATE_ACTION))
{
throw new ModelException(I18NHelper.getMessage(getMessages(),
"jdo.relationship.delete_action_invalid", action)); // NOI18N
}
getRelationshipImpl().setDeleteAction(action);
|
public void | setElementClass(java.lang.String elementClass)Set the element class for this relationship element.
getRelationshipImpl().setElementClass(elementClass);
|
public void | setInverseRelationship(com.sun.jdo.api.persistence.model.jdo.RelationshipElement inverseRelationship, com.sun.jdo.api.persistence.model.Model model)Set the inverse relationship element for this relationship element.
In the case of two-way relationships, the two relationship elements
involved are inverses of each other.
RelationshipElement old = getInverseRelationship(model);
if ((old != inverseRelationship) || ((inverseRelationship == null) &&
(getInverseRelationshipName() != null)))
{
// clear old inverse which still points to here
if (old != null)
{
RelationshipElement oldInverse =
old.getInverseRelationship(model);
if (this.equals(oldInverse))
old.changeInverseRelationship(null);
}
// link from here to new inverse
changeInverseRelationship(inverseRelationship);
// link from new inverse back to here
if (inverseRelationship != null)
inverseRelationship.changeInverseRelationship(this);
}
|
public void | setLowerBound(int lowerBound)Set the lower cardinality bound for this relationship element.
if ((lowerBound > getUpperBound()) || (lowerBound < 0))
{
throw new ModelException(I18NHelper.getMessage(getMessages(),
"jdo.relationship.lower_cardinality_invalid")); // NOI18N
}
getRelationshipImpl().setLowerBound(lowerBound);
|
public void | setPrefetch(boolean flag)Set whether this relationship element should prefetch or not.
getRelationshipImpl().setPrefetch(flag);
|
public void | setUpdateAction(int action)Set the update action for this relationship element.
if ((action < NONE_ACTION) || (action > AGGREGATE_ACTION))
{
throw new ModelException(I18NHelper.getMessage(getMessages(),
"jdo.relationship.update_action_invalid", action)); // NOI18N
}
getRelationshipImpl().setUpdateAction(action);
|
public void | setUpperBound(int upperBound)Set the upper cardinality bound for this relationship element.
if ((upperBound < getLowerBound()) || (upperBound <= 0))
{
throw new ModelException(I18NHelper.getMessage(getMessages(),
"jdo.relationship.upper_cardinality_invalid")); // NOI18N
}
getRelationshipImpl().setUpperBound(upperBound);
|