org.apache.jdo.model.jdo
Interface JDORelationship

All Superinterfaces:
JDOElement
All Known Subinterfaces:
JDOArray, JDOCollection, JDOMap, JDOReference
All Known Implementing Classes:
JDOArrayImplDynamic, JDOCollectionImplDynamic, JDOMapImplDynamic, JDOReferenceImpl, JDORelationshipImpl

public interface JDORelationship
extends JDOElement

JDORelationship is the super interface for all interfaces representing JDO relationship metadata of a managed field of a persistence-capable class.

Author:
Michael Bouschen

Field Summary
static int CARDINALITY_N
          Constant representing the cardinality n used for lower and upper bounds.
static int CARDINALITY_ONE
          Constant representing the cardinality one used for lower and upper bounds.
static int CARDINALITY_ZERO
          Constant representing the cardinality zero used for lower and upper bounds.
 
Method Summary
 JDOField getDeclaringField()
          Get the declaring field of this JDORelationship.
 JDORelationship getInverseRelationship()
          Get the inverse JDORelationship in the case of a managed relationship.
 int getLowerBound()
          Get the lower cardinality bound for this relationship element.
 int getUpperBound()
          Get the upper cardinality bound for this relationship element.
 void setDeclaringField(JDOField declaringField)
          Set the declaring field of this JDORelationship.
 void setInverseRelationship(JDORelationship inverseRelationship)
          Set the inverse JDORelationship in the case of a managed relationship.
 void setLowerBound(int lowerBound)
          Set the lower cardinality bound for this relationship element.
 void setUpperBound(int upperBound)
          Set the upper cardinality bound for this relationship element.
 
Methods inherited from interface org.apache.jdo.model.jdo.JDOElement
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener
 

Field Detail

CARDINALITY_ZERO

public static final int CARDINALITY_ZERO
Constant representing the cardinality zero used for lower and upper bounds.

See Also:
Constant Field Values

CARDINALITY_ONE

public static final int CARDINALITY_ONE
Constant representing the cardinality one used for lower and upper bounds.

See Also:
Constant Field Values

CARDINALITY_N

public static final int CARDINALITY_N
Constant representing the cardinality n used for lower and upper bounds.

See Also:
Constant Field Values
Method Detail

getLowerBound

public int getLowerBound()
Get the lower cardinality bound for this relationship element.

Returns:
the lower cardinality bound

setLowerBound

public 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

public int getUpperBound()
Get the upper cardinality bound for this relationship element.

Returns:
the upper cardinality bound

setUpperBound

public void setUpperBound(int upperBound)
                   throws ModelException
Set the upper cardinality bound for this relationship element.

Parameters:
upperBound - an integer indicating the upper cardinality bound
Throws:
ModelException - if impossible

getDeclaringField

public JDOField getDeclaringField()
Get the declaring field of this JDORelationship.

Returns:
the field that owns this JDORelationship, or null if the element is not attached to any field

setDeclaringField

public void setDeclaringField(JDOField declaringField)
                       throws ModelException
Set the declaring field of this JDORelationship.

Parameters:
declaringField - the declaring field of this relationship element
Throws:
ModelException - if impossible

getInverseRelationship

public JDORelationship getInverseRelationship()
Get the inverse JDORelationship in the case of a managed relationship.

Returns:
the inverse relationship

setInverseRelationship

public void setInverseRelationship(JDORelationship inverseRelationship)
                            throws ModelException
Set the inverse JDORelationship in the case of a managed relationship.

Parameters:
inverseRelationship - the inverse relationship
Throws:
ModelException - if impossible