public class Association extends ModelElement
Modifier and Type | Field and Description |
---|---|
Table |
destination
The destination table.
|
static java.lang.String |
NULL_FILTER_COMMENT_PREFIX |
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,
java.lang.String joinCondition,
DataModel dataModel,
boolean reversed,
Cardinality cardinality)
Constructor.
|
Association(Table source,
Table destination,
boolean insertSourceBeforeDestination,
boolean insertDestinationBeforeSource,
java.lang.String joinCondition,
DataModel dataModel,
boolean reversed,
Cardinality cardinality,
java.lang.String author)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendCondition(java.lang.String condition)
Appends condition to join-condition.
|
java.util.Map<Column,Column> |
createSourceToDestinationKeyMapping()
Maps source-columns to destination-columns, if this represents an
equi-join.
|
java.util.Map<Column,Column> |
createSourceToDestinationKeyMapping(java.util.Set<Pair<Column,Column>> assignments)
Maps source-columns to destination-columns, if this represents an
equi-join.
|
boolean |
fkHasExcludeFilter() |
boolean |
fkHasNullFilter() |
AggregationSchema |
getAggregationSchema()
Gets the XML aggregation schema.
|
java.lang.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.
|
java.lang.String |
getJoinCondition()
Gets the restricted join-condition for joining source with destination
table.
|
java.lang.String |
getName()
Gets the name of the association.
|
java.lang.String |
getRestrictionCondition()
Gets restriction-condition.
|
java.lang.String |
getUnrestrictedJoinCondition()
Gets join-condition without any restrictions.
|
boolean |
hasNullableFK() |
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.
|
boolean |
isRestrictedDependencyWithNulledFK() |
java.lang.String |
renderJoinCondition(java.lang.String restrictionSeparator)
Stringifies the join condition.
|
void |
setAggregationSchema(AggregationSchema aggregationSchema)
Sets the XML aggregation schema.
|
void |
setAggregationTagName(java.lang.String aggregationTagName)
Sets name of XML-tag used for aggregation.
|
void |
setName(java.lang.String name)
Sets the name of the association.
|
boolean |
setOrResetFKNullFilter(boolean set) |
java.lang.String |
toString()
Stringifies the association.
|
java.lang.String |
toString(int maxGab,
boolean useDisplayName)
Stringifies the association.
|
getAuthor, setAuthor
public final Table source
public final Table destination
public final boolean reversed
true
for reversed association.public Association reversalAssociation
public static final java.lang.String NULL_FILTER_COMMENT_PREFIX
public Association(Table source, Table destination, boolean insertSourceBeforeDestination, boolean insertDestinationBeforeSource, java.lang.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, java.lang.String joinCondition, DataModel dataModel, boolean reversed, Cardinality cardinality, java.lang.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 java.lang.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 java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int maxGab, boolean useDisplayName)
public java.lang.String renderJoinCondition(java.lang.String restrictionSeparator)
restrictionSeparator
- separates join-condition from restriction condition in the
resultpublic java.lang.String getUnrestrictedJoinCondition()
public java.lang.String getRestrictionCondition()
null
if association is not
restrictedpublic void setName(java.lang.String name)
name
- the name of the associationpublic java.lang.String getName()
public boolean isInsertSourceBeforeDestination()
public boolean isInsertDestinationBeforeSource()
public boolean isRestricted()
public void appendCondition(java.lang.String condition)
condition
- the conditionpublic AggregationSchema getAggregationSchema()
public java.lang.String getAggregationTagName()
public void setAggregationSchema(AggregationSchema aggregationSchema)
aggregationSchema
- the XML aggregation schemapublic void setAggregationTagName(java.lang.String aggregationTagName)
aggregationTagName
- name of XML-tag used for aggregationpublic int getId()
public DataModel getDataModel()
public java.util.Map<Column,Column> createSourceToDestinationKeyMapping()
public java.util.Map<Column,Column> createSourceToDestinationKeyMapping(java.util.Set<Pair<Column,Column>> assignments)
assignments
- if not null
, put column assignments into itpublic boolean hasNullableFK()
public boolean fkHasNullFilter()
public boolean fkHasExcludeFilter()
public boolean setOrResetFKNullFilter(boolean set)
public boolean isRestrictedDependencyWithNulledFK()