public abstract class Relationship extends Object implements CayenneMapEntry, XMLSerializable, Serializable
Modifier and Type | Field and Description |
---|---|
protected String |
name |
protected boolean |
runtime
A flag that specifies whether a Relationship was mapped by the user or added
dynamically by Cayenne runtime.
|
protected Entity |
sourceEntity |
protected String |
targetEntityName |
protected boolean |
toMany |
Constructor and Description |
---|
Relationship()
Creates an unnamed relationship.
|
Relationship(String name)
Creates a named relationship.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Returns the name property of this object.
|
Object |
getParent()
Returns the parent map.
|
abstract Relationship |
getReverseRelationship()
Returns a "complimentary" relationship going in the opposite direction.
|
Entity |
getSourceEntity()
Returns relationship source entity.
|
abstract Entity |
getTargetEntity()
Returns a target entity of the relationship.
|
String |
getTargetEntityName()
Returns the name of a target entity.
|
abstract boolean |
isMandatory()
Returns if relationship is mandatory
|
boolean |
isRuntime() |
boolean |
isToMany()
Returns a boolean value that determines relationship multiplicity.
|
void |
setName(String name) |
void |
setParent(Object parent)
Stores the parent map.
|
void |
setRuntime(boolean synthetic) |
void |
setSourceEntity(Entity sourceEntity)
Sets relationship source entity.
|
void |
setTargetEntityName(Entity targetEntity)
Sets relationship target entity.
|
void |
setTargetEntityName(String targetEntityName)
Sets the name of relationship target entity.
|
String |
toString()
Overrides Object.toString() to return informative description.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
encodeAsXML
protected String name
protected Entity sourceEntity
protected String targetEntityName
protected boolean toMany
protected boolean runtime
public Relationship()
public Relationship(String name)
public String getName()
CayenneMapEntry
getName
in interface CayenneMapEntry
public void setName(String name)
public Entity getSourceEntity()
public void setSourceEntity(Entity sourceEntity)
public abstract Entity getTargetEntity()
public void setTargetEntityName(Entity targetEntity)
setTargetEntityName
.public String getTargetEntityName()
public void setTargetEntityName(String targetEntityName)
public boolean isToMany()
public Object getParent()
CayenneMapEntry
getParent
in interface CayenneMapEntry
public void setParent(Object parent)
CayenneMapEntry
setParent
in interface CayenneMapEntry
public String toString()
public boolean isRuntime()
public void setRuntime(boolean synthetic)
public abstract Relationship getReverseRelationship()
public abstract boolean isMandatory()
Copyright © 2001–2023 Apache Cayenne. All rights reserved.