|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.map.Relationship
org.apache.cayenne.map.ObjRelationship
public class ObjRelationship
Describes navigational association between two Java classes, represented as source and target ObjEntity. Maps to a path of DbRelationships.
Field Summary | |
---|---|
protected java.lang.String |
dbRelationshipPath
|
protected java.util.List |
dbRelationships
|
protected int |
deleteRule
|
protected boolean |
usedForLocking
|
Fields inherited from class org.apache.cayenne.map.Relationship |
---|
name, sourceEntity, targetEntityName, toMany |
Constructor Summary | |
---|---|
ObjRelationship()
|
|
ObjRelationship(java.lang.String name)
|
Method Summary | |
---|---|
void |
addDbRelationship(DbRelationship dbRel)
Appends a DbRelationship to the existing list of DbRelationships. |
void |
clearDbRelationships()
|
void |
dbRelationshipDidChange(RelationshipEvent event)
|
void |
encodeAsXML(XMLEncoder encoder)
Prints itself as XML to the provided XMLEncoder. |
ObjRelationship |
getClientRelationship()
Returns an ObjAttribute stripped of any server-side information, such as DbAttribute mapping. |
java.lang.String |
getDbRelationshipPath()
Returns a dot-separated path over mapped DbRelationships. |
java.util.List |
getDbRelationships()
Returns an immutable list of underlying DbRelationships. |
int |
getDeleteRule()
Returns the deleteRule. |
java.lang.String |
getReverseDbRelationshipPath()
Returns a reversed dbRelationship path. |
ObjRelationship |
getReverseRelationship()
Returns a "complimentary" ObjRelationship going in the opposite direction. |
java.lang.String |
getReverseRelationshipName()
Returns the name of a complimentary relationship going in the opposite direction or null if it doesn't exist. |
Entity |
getTargetEntity()
Returns a target ObjEntity of this relationship. |
boolean |
isFlattened()
Returns true if the relationship is a "flattened" relationship. |
boolean |
isReadOnly()
Returns true if the relationship is flattened, but is not of the single case that can have automatic write support. |
boolean |
isSourceIndependentFromTargetChange()
Returns a boolean indicating whether modifying a target of such relationship in any way will not change the underlying table row of the source. |
boolean |
isToDependentEntity()
Returns true if underlying DbRelationships point to dependent entity. |
boolean |
isToMany()
Returns a boolean value that determines relationship multiplicity. |
boolean |
isToPK()
Returns true if the underlying DbRelationships point to a at least one of the columns of the target entity. |
boolean |
isUsedForLocking()
Returns whether this attribute should be used for locking. |
void |
removeDbRelationship(DbRelationship dbRel)
Removes the relationship dbRel from the list of relationships. |
void |
setDbRelationshipPath(java.lang.String relationshipPath)
Sets mapped DbRelationships as a dot-separated path. |
void |
setDeleteRule(int value)
Sets the delete rule of the relationship. |
void |
setUsedForLocking(boolean usedForLocking)
Sets whether this attribute should be used for locking. |
java.lang.String |
toString()
Overrides Object.toString() to return informative description. |
Methods inherited from class org.apache.cayenne.map.Relationship |
---|
getName, getParent, getSourceEntity, getTargetEntityName, setName, setParent, setSourceEntity, setTargetEntity, setTargetEntityName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int deleteRule
protected boolean usedForLocking
protected java.lang.String dbRelationshipPath
protected java.util.List dbRelationships
Constructor Detail |
---|
public ObjRelationship()
public ObjRelationship(java.lang.String name)
Method Detail |
---|
public void encodeAsXML(XMLEncoder encoder)
encodeAsXML
in interface XMLSerializable
public Entity getTargetEntity()
getTargetEntity
in class Relationship
public java.lang.String getReverseRelationshipName()
public ObjRelationship getReverseRelationship()
public java.util.List getDbRelationships()
public void addDbRelationship(DbRelationship dbRel)
public void removeDbRelationship(DbRelationship dbRel)
dbRel
from the list of relationships.
public void clearDbRelationships()
public boolean isSourceIndependentFromTargetChange()
public boolean isToDependentEntity()
public boolean isToPK()
public boolean isFlattened()
isReadOnly()
public boolean isReadOnly()
public boolean isToMany()
Relationship
isToMany
in class Relationship
public int getDeleteRule()
setDeleteRule(int)
public void setDeleteRule(int value)
value
- New delete rule. Must be one of the constants defined in DeleteRule
class.
java.lang.IllegalArgumentException
- if the value is not a valid delete rule.DeleteRule
public void dbRelationshipDidChange(RelationshipEvent event)
public boolean isUsedForLocking()
public void setUsedForLocking(boolean usedForLocking)
public java.lang.String getDbRelationshipPath()
public java.lang.String getReverseDbRelationshipPath() throws ExpressionException
ExpressionException
public void setDbRelationshipPath(java.lang.String relationshipPath)
public java.lang.String toString()
Relationship
toString
in class Relationship
public ObjRelationship getClientRelationship()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |