public class Association extends ModelElement
| Modifier and Type | Field and Description |
|---|---|
Table |
destination
The destination table.
|
Association |
reversalAssociation
The counterpart of the association for the reversal direction.
|
boolean |
reversed
true for reversed association. |
Table |
source
The source table.
|
| Constructor and Description |
|---|
Association(Table source,
Table destination,
boolean insertSourceBeforeDestination,
boolean insertDestinationBeforeSource,
String joinCondition,
DataModel dataModel,
boolean reversed,
Cardinality cardinality)
Constructor.
|
Association(Table source,
Table destination,
boolean insertSourceBeforeDestination,
boolean insertDestinationBeforeSource,
String joinCondition,
DataModel dataModel,
boolean reversed,
Cardinality cardinality,
String author)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendCondition(String condition)
Appends condition to join-condition.
|
Map<Column,Column> |
createSourceToDestinationKeyMapping()
Maps source-columns to destination-columns, if this represents an
equi-join.
|
AggregationSchema |
getAggregationSchema()
Gets the XML aggregation schema.
|
String |
getAggregationTagName()
Gets name of XML-tag used for aggregation.
|
Cardinality |
getCardinality()
Gets the cardinality.
|
DataModel |
getDataModel()
Gets data-model to which this association belongs to.
|
int |
getId()
Gets unique ID.
|
String |
getJoinCondition()
Gets the restricted join-condition for joining source with destination
table.
|
String |
getName()
Gets the name of the association.
|
String |
getRestrictionCondition()
Gets restriction-condition.
|
String |
getUnrestrictedJoinCondition()
Gets join-condition without any restrictions.
|
boolean |
isIgnored()
Is this association ignored?
|
boolean |
isInsertDestinationBeforeSource()
Whether or not to insert destination-rows before source-rows in order to
prevent foreign-key-constraint violation.
|
boolean |
isInsertSourceBeforeDestination()
Whether or not to insert source-rows before destination rows in order to
prevent foreign-key-constraint violation.
|
boolean |
isRestricted()
Whether there is any restriction of this association.
|
String |
renderJoinCondition(String restrictionSeparator)
Stringifies the join condition.
|
void |
setAggregationSchema(AggregationSchema aggregationSchema)
Sets the XML aggregation schema.
|
void |
setAggregationTagName(String aggregationTagName)
Sets name of XML-tag used for aggregation.
|
void |
setName(String name)
Sets the name of the association.
|
String |
toString()
Stringifies the association.
|
String |
toString(int maxGab,
boolean useDisplayName)
Stringifies the association.
|
getAuthor, setAuthorpublic final Table source
public final Table destination
public final boolean reversed
true for reversed association.public Association reversalAssociation
public Association(Table source, Table destination, boolean insertSourceBeforeDestination, boolean insertDestinationBeforeSource, String joinCondition, DataModel dataModel, boolean reversed, Cardinality cardinality)
source - the source tabledestination - the destination tablejoinCondition - the join-condition for join with destination tableinsertSourceBeforeDestination - whether or not to insert source-rows before destination rows
in order to prevent foreign-key-constraint violationinsertDestinationBeforeSource - whether or not to insert destination-rows before source-rows
in order to prevent foreign-key-constraint violationdataModel - data-model containing this associationreversed - true for reversed associationcardinality - the cardinality (optional)public Association(Table source, Table destination, boolean insertSourceBeforeDestination, boolean insertDestinationBeforeSource, String joinCondition, DataModel dataModel, boolean reversed, Cardinality cardinality, String author)
source - the source tabledestination - the destination tablejoinCondition - the join-condition for join with destination tableinsertSourceBeforeDestination - whether or not to insert source-rows before destination rows
in order to prevent foreign-key-constraint violationinsertDestinationBeforeSource - whether or not to insert destination-rows before source-rows
in order to prevent foreign-key-constraint violationdataModel - data-model containing this associationreversed - true for reversed associationcardinality - the cardinality (optional)author - the authorpublic String getJoinCondition()
null if association must be ignoredpublic boolean isIgnored()
true iff this association is ignoredpublic Cardinality getCardinality()
null if cardinality is not known.public String toString(int maxGab, boolean useDisplayName)
public String renderJoinCondition(String restrictionSeparator)
restrictionSeparator - separates join-condition from restriction condition in the
resultpublic String getUnrestrictedJoinCondition()
public String getRestrictionCondition()
null if association is not
restrictedpublic void setName(String name)
name - the name of the associationpublic String getName()
public boolean isInsertSourceBeforeDestination()
public boolean isInsertDestinationBeforeSource()
public boolean isRestricted()
public void appendCondition(String condition)
condition - the conditionpublic AggregationSchema getAggregationSchema()
public String getAggregationTagName()
public void setAggregationSchema(AggregationSchema aggregationSchema)
aggregationSchema - the XML aggregation schemapublic void setAggregationTagName(String aggregationTagName)
aggregationTagName - name of XML-tag used for aggregationpublic int getId()
public DataModel getDataModel()