RelationshipElementImplpublic class RelationshipElementImpl extends PersistenceFieldElementImpl implements RelationshipElement.Impl
Fields Summary |
---|
private int | _updateActionUpdate action of the relationship element. | private int | _deleteActionDelete action of the relationship element. | private boolean | _isPrefetchFlag indicating whether this relationship element should prefetch. | private int | _lowerBoundLower cardinality bound of the relationship element. | private int | _upperBoundUpper cardinality bound of the relationship element. | private String | _collectionClassCollection lass of the relationship element. | private String | _elementClassElement class of the relationship element. | private String | _inverseRelationshipNameRelative name of the inverse relationship. |
Constructors Summary |
---|
public RelationshipElementImpl()Create new RelationshipElementImpl with no corresponding name. This
constructor should only be used for cloning and archiving.
this(null);
| public RelationshipElementImpl(String name)Creates new RelationshipElementImpl with the corresponding name
super(name);
_updateAction = RelationshipElement.NONE_ACTION;
_deleteAction = RelationshipElement.NONE_ACTION;
_isPrefetch = false;
_lowerBound = 0;
_upperBound = Integer.MAX_VALUE;
|
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.
String newName = ((inverseRelationship != null) ?
inverseRelationship.getName() : null);
String oldName = getInverseRelationshipName();
try
{
fireVetoableChange(PROP_INVERSE_FIELD, oldName, newName);
_inverseRelationshipName = newName;
firePropertyChange(PROP_INVERSE_FIELD, oldName, newName);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
| public java.lang.String | getCollectionClass()Get the collection class (for example Set, List, Vector, etc.)
for this relationship element. return _collectionClass;
| public int | getDeleteAction()Get the delete action for this relationship element. return _deleteAction;
| 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 _elementClass;
| 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 _inverseRelationshipName;
| public int | getLowerBound()Get the lower cardinality bound for this relationship element. The
default is 0. return _lowerBound;
| public int | getUpdateAction()Get the update action for this relationship element. return _updateAction;
| public int | getUpperBound()Get the upper cardinality bound for this relationship element. The
default is Integer.MAX_VALUE.
Returns {@link java.lang.Integer#MAX_VALUE} for n return _upperBound;
| public boolean | isPrefetch()Determines whether this relationship element should prefetch or not. return _isPrefetch;
| public void | setCollectionClass(java.lang.String collectionClass)Set the collection class for this relationship element.
String old = getCollectionClass();
try
{
fireVetoableChange(PROP_COLLECTION_CLASS, old, collectionClass);
_collectionClass = collectionClass;
firePropertyChange(PROP_COLLECTION_CLASS, old, collectionClass);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
| public void | setDeleteAction(int action)Set the delete action for this relationship element.
Integer old = new Integer(getDeleteAction());
Integer newAction = new Integer(action);
try
{
fireVetoableChange(PROP_DELETE_ACTION, old, newAction);
_deleteAction = action;
firePropertyChange(PROP_DELETE_ACTION, old, newAction);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
| public void | setElementClass(java.lang.String elementClass)Set the element class for this relationship element.
String old = getElementClass();
try
{
fireVetoableChange(PROP_ELEMENT_CLASS, old, elementClass);
_elementClass = elementClass;
firePropertyChange(PROP_ELEMENT_CLASS, old, elementClass);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
| public void | setLowerBound(int lowerBound)Set the lower cardinality bound for this relationship element.
Integer old = new Integer(getLowerBound());
Integer newBound = new Integer(lowerBound);
try
{
fireVetoableChange(PROP_CARDINALITY, old, newBound);
_lowerBound = lowerBound;
firePropertyChange(PROP_CARDINALITY, old, newBound);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
| public void | setPrefetch(boolean flag)Set whether this relationship element should prefetch or not.
Boolean old = JavaTypeHelper.valueOf(isPrefetch());
Boolean newFlag = JavaTypeHelper.valueOf(flag);
try
{
fireVetoableChange(PROP_PREFETCH, old, newFlag);
_isPrefetch = flag;
firePropertyChange(PROP_PREFETCH, old, newFlag);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
| public void | setUpdateAction(int action)Set the update action for this relationship element.
Integer old = new Integer(getUpdateAction());
Integer newAction = new Integer(action);
try
{
fireVetoableChange(PROP_UPDATE_ACTION, old, newAction);
_updateAction = action;
firePropertyChange(PROP_UPDATE_ACTION, old, newAction);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
| public void | setUpperBound(int upperBound)Set the upper cardinality bound for this relationship element.
Integer old = new Integer(getUpperBound());
Integer newBound = new Integer(upperBound);
try
{
fireVetoableChange(PROP_CARDINALITY, old, newBound);
_upperBound = upperBound;
firePropertyChange(PROP_CARDINALITY, old, newBound);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
|
|