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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionForeignKeyConstraint(String name, String sourceField, String targetField, String targetTable) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSourceField(String sourceField) voidaddTargetField(String targetField) voidappendDBString(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Append the database field definition string to the table creation statement.voidPUBLIC: Enables delete cascading on the database.booleanvoidPUBLIC: Disables delete cascading on the database, this is the default.getName()booleanbooleanvoidsetDisableForeignKey(boolean disableForeignKey) voidsetForeignKeyDefinition(String foreignKeyDefinition) voidvoidsetShouldCascadeOnDelete(boolean shouldCascadeOnDelete) PUBLIC: Enables delete cascading on the database.voidsetSourceFields(List<String> sourceFields) voidsetTargetFields(List<String> targetFields) voidsetTargetTable(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()
-