EclipseLink 1.1.4, build 'v20100812-r7860' API Reference

org.eclipse.persistence.tools.schemaframework
Class ForeignKeyConstraint

java.lang.Object
  extended by org.eclipse.persistence.tools.schemaframework.ForeignKeyConstraint
All Implemented Interfaces:
java.io.Serializable

public class ForeignKeyConstraint
extends java.lang.Object
implements java.io.Serializable

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

See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
protected  boolean shouldCascadeOnDelete
           
protected  java.util.Vector sourceFields
           
protected  java.util.Vector targetFields
           
protected  java.lang.String targetTable
           
 
Constructor Summary
ForeignKeyConstraint()
           
ForeignKeyConstraint(java.lang.String name, java.lang.String sourceField, java.lang.String targetField, java.lang.String targetTable)
           
 
Method Summary
 void addSourceField(java.lang.String sourceField)
           
 void addTargetField(java.lang.String targetField)
           
 void appendDBString(java.io.Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Append the database field definition string to the table creation statement.
 void cascadeOnDelete()
          PUBLIC: Enables delete cascading on the database.
 void dontCascadeOnDelete()
          PUBLIC: Disables delete cascading on the database, this is the default.
 java.lang.String getName()
           
 java.util.Vector getSourceFields()
           
 java.util.Vector getTargetFields()
           
 java.lang.String getTargetTable()
           
 void setName(java.lang.String name)
           
 void setShouldCascadeOnDelete(boolean shouldCascadeOnDelete)
          PUBLIC: Enables delete cascading on the database.
 void setSourceFields(java.util.Vector sourceFields)
           
 void setTargetFields(java.util.Vector targetFields)
           
 void setTargetTable(java.lang.String targetTable)
           
 boolean shouldCascadeOnDelete()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

sourceFields

protected java.util.Vector sourceFields

targetFields

protected java.util.Vector targetFields

targetTable

protected java.lang.String targetTable

shouldCascadeOnDelete

protected boolean shouldCascadeOnDelete
Constructor Detail

ForeignKeyConstraint

public ForeignKeyConstraint()

ForeignKeyConstraint

public ForeignKeyConstraint(java.lang.String name,
                            java.lang.String sourceField,
                            java.lang.String targetField,
                            java.lang.String targetTable)
Method Detail

addSourceField

public void addSourceField(java.lang.String sourceField)

addTargetField

public void addTargetField(java.lang.String targetField)

appendDBString

public void appendDBString(java.io.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.


dontCascadeOnDelete

public void dontCascadeOnDelete()
PUBLIC: Disables delete cascading on the database, this is the default.


getName

public java.lang.String getName()

getSourceFields

public java.util.Vector getSourceFields()

getTargetFields

public java.util.Vector getTargetFields()

getTargetTable

public java.lang.String getTargetTable()

setName

public void setName(java.lang.String name)

setShouldCascadeOnDelete

public void setShouldCascadeOnDelete(boolean shouldCascadeOnDelete)
PUBLIC: Enables delete cascading on the database. This must be used carefully, i.e. only private relationships.


setSourceFields

public void setSourceFields(java.util.Vector sourceFields)

setTargetFields

public void setTargetFields(java.util.Vector targetFields)

setTargetTable

public void setTargetTable(java.lang.String targetTable)

shouldCascadeOnDelete

public boolean shouldCascadeOnDelete()

EclipseLink 1.1.4, build 'v20100812-r7860' API Reference