|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.cpa.persistence.sql.engine.info.TableLink
public final class TableLink
Class representing relations between tables. There are 3 possible types of tableLinks: SIMPLE: Used for 1:1 relations. No join will be added to the query. Just the startColumns will be added to the query. MANY_KEY: Used to express 1:m relations. Join will be added to the query. MANY_TABLE: Used to express n:m relations. Join will be added to the query.
| Field Summary | |
|---|---|
static int |
MANY_TO_MANY
Constant defining many table relation (n:m). |
static int |
REFERED_BY
Constant defining many key relation (1:m). |
static int |
REFERS_TO
Constant defining simple table-link (1:1). |
| Constructor Summary | |
|---|---|
protected |
TableLink(TableInfo targetTable,
int relationType,
String tableAlias,
List<ColumnInfo> startColumns,
int fieldIndex)
Constructor. |
| Method Summary | |
|---|---|
void |
addTargetCol(ColumnInfo col)
Method adding a single targetCol. |
void |
addTargetCols(List<ColumnInfo> cols)
Method adding a list of targetCols. |
int |
getFieldIndex()
Method returning fieldIndex currently set. |
List<String> |
getManyKey()
Method returning many key. |
int |
getRelationType()
Method returning relation type currently set. |
List<ColumnInfo> |
getStartCols()
Method returning a list of start columns. |
String |
getTableAlias()
Method returning the table alias to be used for a potential join. |
List<ColumnInfo> |
getTargetCols()
Method returning a list of target columns. |
TableInfo |
getTargetTable()
Method returning the right table of the join. |
void |
setManyKey(List<String> manyKey)
Method given setting many key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int REFERS_TO
public static final int REFERED_BY
public static final int MANY_TO_MANY
| Constructor Detail |
|---|
protected TableLink(TableInfo targetTable,
int relationType,
String tableAlias,
List<ColumnInfo> startColumns,
int fieldIndex)
targetTable - The right table of the join.relationType - The type of the relation.tableAlias - Alias of the table.startColumns - Columns of the left table needed for joins.fieldIndex - Index of the startColumns.| Method Detail |
|---|
public List<ColumnInfo> getStartCols()
public void addTargetCol(ColumnInfo col)
col - Column to be added as a target column.public void addTargetCols(List<ColumnInfo> cols)
cols - List of columns to be added as target columns.public List<ColumnInfo> getTargetCols()
public TableInfo getTargetTable()
public String getTableAlias()
public int getRelationType()
public void setManyKey(List<String> manyKey)
manyKey - The many key to be set.public List<String> getManyKey()
public int getFieldIndex()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||