public class ForeignKeyConstraint extends Object implements Comparable<ForeignKeyConstraint>
| コンストラクタと説明 |
|---|
ForeignKeyConstraint(TableColumn parentColumn,
TableColumn childColumn)
Same as
ForeignKeyConstraint(TableColumn, TableColumn, int, int),
but defaults updateRule and deleteRule to
DatabaseMetaData.importedKeyNoAction. |
ForeignKeyConstraint(TableColumn parentColumn,
TableColumn childColumn,
int updateRule,
int deleteRule)
This constructor is intended for use after all of the tables have been
found in the system.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
int |
compareTo(ForeignKeyConstraint other)
Custom comparison method to deal with foreign key names that aren't
unique across all schemas being evaluated
|
List<TableColumn> |
getChildColumns()
Returns all of the foreign key columns that are referenced by this constraint.
|
Table |
getChildTable()
Returns the table on the "child" end of the relationship (contains the foreign
key that references the parent table's primary key).
|
int |
getDeleteRule()
Returns the delete rule for this constraint.
|
String |
getDeleteRuleAlias() |
String |
getDeleteRuleDescription() |
String |
getDeleteRuleName() |
String |
getName()
Returns the name of the constraint
|
List<TableColumn> |
getParentColumns()
Returns all of the primary key columns that are referenced by this constraint.
|
Table |
getParentTable()
Returns the parent table (the table that contains the referenced primary key
column).
|
int |
getUpdateRule()
Returns the update rule for this constraint.
|
boolean |
isCascadeOnDelete()
Returns
true if this constraint should
cascade deletions. |
boolean |
isImplied()
Returns
true if this is an implied constraint or
false if it is "real". |
boolean |
isNullOnDelete()
Returns
true if the constraint indicates that the foreign key
will be set to null when the parent key is deleted. |
boolean |
isReal()
We have several types of constraints.
|
boolean |
isRestrictDelete()
Returns
true if the constraint prevents the parent table
from being deleted if child tables exist. |
String |
toString()
Returns a string representation of this foreign key constraint.
|
static String |
toString(List<TableColumn> columns)
Static method that returns a string representation of the specified
list of
columns. |
public ForeignKeyConstraint(TableColumn parentColumn, TableColumn childColumn, int updateRule, int deleteRule)
parentColumn - childColumn - public ForeignKeyConstraint(TableColumn parentColumn, TableColumn childColumn)
ForeignKeyConstraint(TableColumn, TableColumn, int, int),
but defaults updateRule and deleteRule to
DatabaseMetaData.importedKeyNoAction.parentColumn - childColumn - public String getName()
public Table getParentTable()
public List<TableColumn> getParentColumns()
public Table getChildTable()
public List<TableColumn> getChildColumns()
public int getDeleteRule()
java.sql.DatabaseMetaData#importedKeyCascade}public boolean isCascadeOnDelete()
true if this constraint should
cascade deletions.public boolean isRestrictDelete()
true if the constraint prevents the parent table
from being deleted if child tables exist.public boolean isNullOnDelete()
true if the constraint indicates that the foreign key
will be set to null when the parent key is deleted.public String getDeleteRuleName()
public String getDeleteRuleDescription()
public String getDeleteRuleAlias()
public int getUpdateRule()
java.sql.DatabaseMetaData#importedKeyCascade}public boolean isImplied()
true if this is an implied constraint or
false if it is "real".
Subclasses that implement implied constraints should override this method.public boolean isReal()
true if the constraint came from the database
metadata and not inferred by something else.
This is different than isImplied() in that implied relationships
are a specific type of non-real relationships.public int compareTo(ForeignKeyConstraint other)
compareTo インタフェース内 Comparable<ForeignKeyConstraint>other - ForeignKeyConstraintpublic static String toString(List<TableColumn> columns)
columns.columns - Copyright © 2016. All Rights Reserved.