public class LinkColumns
extends java.lang.Object
Constructor and Description |
---|
LinkColumns(AmberTable sourceTable,
AmberTable targetTable,
java.util.ArrayList<ForeignColumn> columns)
Creates the table link.
|
Modifier and Type | Method and Description |
---|---|
void |
afterSourceDelete(AmberConnection aConn,
Entity entity)
Cleans up any fields from a delete.
|
void |
beforeTargetDelete(AmberConnection aConn,
Entity entity)
Cleans up any fields from a delete.
|
void |
generateInsert(java.util.ArrayList<java.lang.String> columns)
Generates SQL insert.
|
java.lang.String |
generateJoin(LinkColumns manyToOneJoin,
java.lang.String sourceTable1,
java.lang.String sourceTable2)
Generates the many-to-many linking.
|
java.lang.String |
generateJoin(java.lang.String sourceTable,
java.lang.String targetTable)
Generates the linking for a join
|
java.lang.String |
generateJoin(java.lang.String sourceTable,
java.lang.String targetTable,
boolean isArg)
Generates the linking for a join
|
java.lang.String |
generateMatchArgSQL(java.lang.String table)
Generates SQL match.
|
java.lang.String |
generateSelectSQL(java.lang.String table)
Generates SQL select.
|
java.lang.String |
generateUpdateSQL()
Generates SQL select.
|
java.lang.String |
generateWhere(java.lang.String sourceTable,
java.lang.String targetTable)
Generates the linking for a where clause
|
java.util.ArrayList<ForeignColumn> |
getColumns()
Returns the component list.
|
ForeignColumn |
getSourceColumn(AmberColumn targetKey)
Generates the linking for a link
|
AmberTable |
getSourceTable()
Returns the source table.
|
AmberTable |
getTargetTable()
Returns the target table.
|
boolean |
isSourceCascadeDelete()
Return true if the source is deleted when the target is deleted.
|
boolean |
isTargetCascadeDelete()
Return true if the source is deleted when the target is deleted.
|
void |
setSourceCascadeDelete(boolean isCascadeDelete)
Sets the cascade-delete of the source when the target is deleted,
i.e.
|
void |
setTargetCascadeDelete(boolean isCascadeDelete)
Sets the cascade-delete of the target when the source is deleted.
|
java.lang.String |
toString() |
public LinkColumns(AmberTable sourceTable, AmberTable targetTable, java.util.ArrayList<ForeignColumn> columns)
public void setSourceCascadeDelete(boolean isCascadeDelete)
public void setTargetCascadeDelete(boolean isCascadeDelete)
public boolean isSourceCascadeDelete()
public boolean isTargetCascadeDelete()
public AmberTable getSourceTable()
public AmberTable getTargetTable()
public java.util.ArrayList<ForeignColumn> getColumns()
public ForeignColumn getSourceColumn(AmberColumn targetKey)
public java.lang.String generateSelectSQL(java.lang.String table)
public void generateInsert(java.util.ArrayList<java.lang.String> columns)
public java.lang.String generateUpdateSQL()
public java.lang.String generateMatchArgSQL(java.lang.String table)
public java.lang.String generateJoin(java.lang.String sourceTable, java.lang.String targetTable)
sourceTable
- the SQL table name for the sourcetargetTable
- the SQL table name for the targetpublic java.lang.String generateJoin(java.lang.String sourceTable, java.lang.String targetTable, boolean isArg)
sourceTable
- the SQL table name for the sourcetargetTable
- the SQL table name for the targetisArg
- true if targetTable is an argument "?"public java.lang.String generateJoin(LinkColumns manyToOneJoin, java.lang.String sourceTable1, java.lang.String sourceTable2)
join
- the many-to-one joinsourceTable1
- the SQL table name for the 1st sourcesourceTable2
- the SQL table name for the 2nd sourcepublic java.lang.String generateWhere(java.lang.String sourceTable, java.lang.String targetTable)
sourceTable
- the SQL table name for the sourcetargetTable
- the SQL table name for the targetpublic void beforeTargetDelete(AmberConnection aConn, Entity entity) throws java.sql.SQLException
java.sql.SQLException
public void afterSourceDelete(AmberConnection aConn, Entity entity) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String toString()
toString
in class java.lang.Object