Top Description Fields Constructors Methods
org.eclipse.persistence.tools.schemaframework

public Class ForeignKeyConstraint

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.*, java.util.*, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.internal.sessions.AbstractSession

Purpose: Define a foreign key from one table to another. This support composite foreign keys can constraint options.

Field Summary

Modifier and TypeField and Description
protected boolean
protected String
protected String
protected boolean
protected List<String>
protected List<String>
protected String

Constructor Summary

AccessConstructor and Description
public
public
ForeignKeyConstraint(String name, String sourceField, String targetField, String targetTable)

Method Summary

Modifier and TypeMethod and Description
public void
addSourceField(String sourceField)

public void
addTargetField(String targetField)

public void
appendDBString(Writer writer, AbstractSession session)

INTERNAL: Append the database field definition string to the table creation statement.

public void
cascadeOnDelete()

PUBLIC: Enables delete cascading on the database.

public boolean
public void
dontCascadeOnDelete()

PUBLIC: Disables delete cascading on the database, this is the default.

public String
public String
public List<String>
public List<String>
public String
public boolean
public boolean
public void
setDisableForeignKey(boolean disableForeignKey)

public void
setForeignKeyDefinition(String foreignKeyDefinition)

public void
public void
setShouldCascadeOnDelete(boolean shouldCascadeOnDelete)

PUBLIC: Enables delete cascading on the database.

public void
setSourceFields(List<String> sourceFields)

public void
setTargetFields(List<String> targetFields)

public void
setTargetTable(String targetTable)

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

disableForeignKeyback to summary
protected boolean disableForeignKey
foreignKeyDefinitionback to summary
protected String foreignKeyDefinition
nameback to summary
protected String name
shouldCascadeOnDeleteback to summary
protected boolean shouldCascadeOnDelete
sourceFieldsback to summary
protected List<String> sourceFields
targetFieldsback to summary
protected List<String> targetFields
targetTableback to summary
protected String targetTable

Constructor Detail

ForeignKeyConstraintback to summary
public ForeignKeyConstraint()
ForeignKeyConstraintback to summary
public ForeignKeyConstraint(String name, String sourceField, String targetField, String targetTable)

Method Detail

addSourceFieldback to summary
public void addSourceField(String sourceField)
addTargetFieldback to summary
public void addTargetField(String targetField)
appendDBStringback to summary
public void appendDBString(Writer writer, AbstractSession session)

INTERNAL: Append the database field definition string to the table creation statement.

cascadeOnDeleteback to summary
public void cascadeOnDelete()

PUBLIC: Enables delete cascading on the database. This must be used carefully, i.e. only private relationships.

disableForeignKeyback to summary
public boolean disableForeignKey()
dontCascadeOnDeleteback to summary
public void dontCascadeOnDelete()

PUBLIC: Disables delete cascading on the database, this is the default.

getForeignKeyDefinitionback to summary
public String getForeignKeyDefinition()
getNameback to summary
public String getName()
getSourceFieldsback to summary
public List<String> getSourceFields()
getTargetFieldsback to summary
public List<String> getTargetFields()
getTargetTableback to summary
public String getTargetTable()
hasForeignKeyDefinitionback to summary
public boolean hasForeignKeyDefinition()
isDisableForeignKeyback to summary
public boolean isDisableForeignKey()
setDisableForeignKeyback to summary
public void setDisableForeignKey(boolean disableForeignKey)
setForeignKeyDefinitionback to summary
public void setForeignKeyDefinition(String foreignKeyDefinition)
setNameback to summary
public void setName(String name)
setShouldCascadeOnDeleteback to summary
public void setShouldCascadeOnDelete(boolean shouldCascadeOnDelete)

PUBLIC: Enables delete cascading on the database. This must be used carefully, i.e. only private relationships.

setSourceFieldsback to summary
public void setSourceFields(List<String> sourceFields)
setTargetFieldsback to summary
public void setTargetFields(List<String> targetFields)
setTargetTableback to summary
public void setTargetTable(String targetTable)
shouldCascadeOnDeleteback to summary
public boolean shouldCascadeOnDelete()