org.apache.jdo.model.jdo
Interface JDORelationship

All Superinterfaces:
JDOElement
All Known Subinterfaces:
JDOArray, JDOCollection, JDOMap, JDOReference
All Known Implementing Classes:
JDOArrayImplCaching, JDOArrayImplDynamic, JDOCollectionImplCaching, JDOCollectionImplDynamic, JDOMapImplCaching, 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

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

See Also:
Constant Field Values

CARDINALITY_ONE

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

See Also:
Constant Field Values

CARDINALITY_N

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

See Also:
Constant Field Values
Method Detail

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.

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
Throws:
ModelException - if impossible

getDeclaringField

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

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

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

Returns:
the inverse relationship

setInverseRelationship

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


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.