public class ForeignKeyMetaData extends Object
Tentackle uses foreign keys only for simple columns (ID).
| Constructor and Description |
|---|
ForeignKeyMetaData(TableMetaData tableMetaData)
Creates foreign key meta data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addForeignKeyColumn(ForeignKeyColumnMetaData column)
Adds a column to the fk.
|
boolean |
equals(Object obj) |
ForeignKeyAction |
getDeleteRule()
Gets the delete rule.
|
List<ForeignKeyColumnMetaData> |
getForeignKeyColumns()
Gets the columns.
|
String |
getForeignKeyName()
Gets the name of the foreign key.
|
String |
getForeignKeySchema()
Geths the schema of the referencing column.
|
String |
getForeignKeyTable()
Gets the referencing table.
|
String |
getFullForeignKeyTableName()
Gets the full foreign key tablename including optional schema.
|
String |
getFullPrimaryKeyTableName()
Gets the full primary key tablename including optional schema.
|
String |
getPrimaryKeySchema()
Gets the schema of the referenced column.
|
String |
getPrimaryKeyTable()
Gets the referenced table.
|
TableMetaData |
getTableMetaData()
Gets the table this foreign key belongs to.
|
ForeignKeyAction |
getUpdateRule()
Gets the update rule.
|
int |
hashCode() |
void |
setupForeignKeyFromMetaData(ResultSet resultSet)
Sets up the foreign key from the database meta data result.
|
String |
toString() |
void |
validate()
Validates and postprocesses the foreign key data.
|
public ForeignKeyMetaData(TableMetaData tableMetaData)
tableMetaData - the tablethis fk belongs topublic void addForeignKeyColumn(ForeignKeyColumnMetaData column)
column - the columnpublic List<ForeignKeyColumnMetaData> getForeignKeyColumns()
public TableMetaData getTableMetaData()
public String getForeignKeyName()
public String getForeignKeySchema()
public String getForeignKeyTable()
public String getFullForeignKeyTableName()
public String getPrimaryKeySchema()
public String getPrimaryKeyTable()
public String getFullPrimaryKeyTableName()
public ForeignKeyAction getUpdateRule()
public ForeignKeyAction getDeleteRule()
public void setupForeignKeyFromMetaData(ResultSet resultSet) throws SQLException
resultSet - the foreign key column result setSQLException - the processing the result set failedpublic void validate()
Tentackle - distributed, domain- and model-driven