Interface RelationshipElement.Impl
-
- All Superinterfaces:
PersistenceElement.Impl
,PersistenceFieldElement.Impl
,PersistenceMemberElement.Impl
- All Known Implementing Classes:
RelationshipElementImpl
- Enclosing class:
- RelationshipElement
public static interface RelationshipElement.Impl extends PersistenceFieldElement.Impl
Pluggable implementation of the storage of relationship element properties.
-
-
Field Summary
-
Fields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
ADD, REMOVE, SET
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
changeInverseRelationship(RelationshipElement inverseRelationship)
Changes the inverse relationship element for this relationship element.String
getCollectionClass()
Get the collection class (for example Set, List, Vector, etc.) for this relationship element.int
getDeleteAction()
Get the delete action for this relationship element.String
getElementClass()
Get the element class for this relationship element.String
getInverseRelationshipName()
Get the relative name of the inverse relationship field for this relationship element.int
getLowerBound()
Get the lower cardinality bound for this relationship element.int
getUpdateAction()
Get the update action for this relationship element.int
getUpperBound()
Get the upper cardinality bound for this relationship element.boolean
isPrefetch()
Determines whether this relationship element should prefetch or not.void
setCollectionClass(String collectionClass)
Set the collection class for this relationship element.void
setDeleteAction(int action)
Set the delete action for this relationship element.void
setElementClass(String elementClass)
Set the element class for this relationship element.void
setLowerBound(int lowerBound)
Set the lower cardinality bound for this relationship element.void
setPrefetch(boolean flag)
Set whether this relationship element should prefetch or not.void
setUpdateAction(int action)
Set the update action for this relationship element.void
setUpperBound(int upperBound)
Set the upper cardinality bound for this relationship element.-
Methods inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
-
Methods inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceFieldElement.Impl
getPersistenceType, isKey, isReadSensitive, isWriteSensitive, setKey, setPersistenceType, setReadSensitive, setWriteSensitive
-
-
-
-
Method Detail
-
getUpdateAction
int getUpdateAction()
Get the update action for this relationship element.- Returns:
- the update action, one of
RelationshipElement.NONE_ACTION
,RelationshipElement.NULLIFY_ACTION
,RelationshipElement.RESTRICT_ACTION
,RelationshipElement.CASCADE_ACTION
, orRelationshipElement.AGGREGATE_ACTION
-
setUpdateAction
void setUpdateAction(int action) throws ModelException
Set the update action for this relationship element.- Parameters:
action
- - an integer indicating the update action, one of:RelationshipElement.NONE_ACTION
,RelationshipElement.NULLIFY_ACTION
,RelationshipElement.RESTRICT_ACTION
,RelationshipElement.CASCADE_ACTION
, orRelationshipElement.AGGREGATE_ACTION
- Throws:
ModelException
- if impossible
-
getDeleteAction
int getDeleteAction()
Get the delete action for this relationship element.- Returns:
- the delete action, one of
RelationshipElement.NONE_ACTION
,RelationshipElement.NULLIFY_ACTION
,RelationshipElement.RESTRICT_ACTION
,RelationshipElement.CASCADE_ACTION
, orRelationshipElement.AGGREGATE_ACTION
-
setDeleteAction
void setDeleteAction(int action) throws ModelException
Set the delete action for this relationship element.- Parameters:
action
- - an integer indicating the delete action, one of:RelationshipElement.NONE_ACTION
,RelationshipElement.NULLIFY_ACTION
,RelationshipElement.RESTRICT_ACTION
,RelationshipElement.CASCADE_ACTION
, orRelationshipElement.AGGREGATE_ACTION
- Throws:
ModelException
- if impossible
-
isPrefetch
boolean isPrefetch()
Determines whether this relationship element should prefetch or not.- Returns:
true
if the relationship should prefetch,false
otherwise
-
setPrefetch
void setPrefetch(boolean flag) throws ModelException
Set whether this relationship element should prefetch or not.- Parameters:
flag
- - iftrue
, the relationship is set to prefetch; otherwise, it is not- Throws:
ModelException
- if impossible
-
getLowerBound
int getLowerBound()
Get the lower cardinality bound for this relationship element.- Returns:
- the lower cardinality bound
-
setLowerBound
void setLowerBound(int lowerBound) throws ModelException
Set the lower cardinality bound for this relationship element.- Parameters:
lowerBound
- - an integer indicating the lower cardinality bound- Throws:
ModelException
- if impossible
-
getUpperBound
int getUpperBound()
Get the upper cardinality bound for this relationship element. ReturnsInteger.MAX_VALUE
forn
- Returns:
- the upper cardinality bound
-
setUpperBound
void setUpperBound(int upperBound) throws ModelException
Set the upper cardinality bound for this relationship element.- Parameters:
upperBound
- - an integer indicating the upper cardinality bound (useInteger.MAX_VALUE
forn
)- Throws:
ModelException
- if impossible
-
getCollectionClass
String getCollectionClass()
Get the collection class (for example Set, List, Vector, etc.) for this relationship element.- Returns:
- the collection class
-
setCollectionClass
void setCollectionClass(String collectionClass) throws ModelException
Set the collection class for this relationship element.- Parameters:
collectionClass
- - a string indicating the type of collection (for example Set, List, Vector, etc.)- Throws:
ModelException
- if impossible
-
getElementClass
String getElementClass()
Get the element class for this relationship element. If primitive types are supported, you can usewrapperclass.TYPE.toString()
to specify them.- Returns:
- the element class
-
setElementClass
void setElementClass(String elementClass) throws ModelException
Set the element class for this relationship element.- Parameters:
elementClass
- - a string indicating the type of elements in the collection. If primitive types are supported, you can usewrapperclass.TYPE.toString()
to specify them.- Throws:
ModelException
- if impossible
-
getInverseRelationshipName
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 returnsnull
. 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.- Returns:
- the relative name of the inverse relationship element
- See Also:
RelationshipElement.getInverseRelationship(com.sun.jdo.api.persistence.model.Model)
-
changeInverseRelationship
void changeInverseRelationship(RelationshipElement inverseRelationship) throws ModelException
Changes the inverse relationship element for this relationship element. This method is invoked for both sides fromRelationshipElement.setInverseRelationship(com.sun.jdo.api.persistence.model.jdo.RelationshipElement, com.sun.jdo.api.persistence.model.Model)
and should handle the vetoable change events, property change events, and setting the internal variable.- Parameters:
inverseRelationship
- - a relationship element to be used as the inverse for this relationship element ornull
if this relationship element does not participate in a two-way relationship.- Throws:
ModelException
- if impossible
-
-