Class ForeignKeyConstraint
java.lang.Object
org.eclipse.persistence.tools.schemaframework.ForeignKeyConstraint
- All Implemented Interfaces:
Serializable
Purpose: Define a foreign key from one table to another. This support composite foreign keys can constraint options.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionForeignKeyConstraint
(String name, String sourceField, String targetField, String targetTable) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSourceField
(String sourceField) void
addTargetField
(String targetField) void
appendDBString
(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Append the database field definition string to the table creation statement.void
PUBLIC: Enables delete cascading on the database.boolean
void
PUBLIC: Disables delete cascading on the database, this is the default.getName()
boolean
boolean
void
setDisableForeignKey
(boolean disableForeignKey) void
setForeignKeyDefinition
(String foreignKeyDefinition) void
void
setShouldCascadeOnDelete
(boolean shouldCascadeOnDelete) PUBLIC: Enables delete cascading on the database.void
setSourceFields
(List<String> sourceFields) void
setTargetFields
(List<String> targetFields) void
setTargetTable
(String targetTable) boolean
-
Field Details
-
name
-
sourceFields
-
targetFields
-
targetTable
-
shouldCascadeOnDelete
protected boolean shouldCascadeOnDelete -
foreignKeyDefinition
-
disableForeignKey
protected boolean disableForeignKey
-
-
Constructor Details
-
ForeignKeyConstraint
public ForeignKeyConstraint() -
ForeignKeyConstraint
-
-
Method Details
-
addSourceField
-
addTargetField
-
appendDBString
public void appendDBString(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Append the database field definition string to the table creation statement. -
cascadeOnDelete
public void cascadeOnDelete()PUBLIC: Enables delete cascading on the database. This must be used carefully, i.e. only private relationships. -
disableForeignKey
public boolean disableForeignKey() -
dontCascadeOnDelete
public void dontCascadeOnDelete()PUBLIC: Disables delete cascading on the database, this is the default. -
getForeignKeyDefinition
-
getName
-
getSourceFields
-
getTargetFields
-
getTargetTable
-
hasForeignKeyDefinition
public boolean hasForeignKeyDefinition() -
isDisableForeignKey
public boolean isDisableForeignKey() -
setDisableForeignKey
public void setDisableForeignKey(boolean disableForeignKey) -
setForeignKeyDefinition
-
setName
-
setShouldCascadeOnDelete
public void setShouldCascadeOnDelete(boolean shouldCascadeOnDelete) PUBLIC: Enables delete cascading on the database. This must be used carefully, i.e. only private relationships. -
setSourceFields
-
setTargetFields
-
setTargetTable
-
shouldCascadeOnDelete
public boolean shouldCascadeOnDelete()
-