|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.metadata.MetaData
org.jpox.metadata.AbstractConstraintMetaData
org.jpox.metadata.ForeignKeyMetaData
public class ForeignKeyMetaData
Foreign keys in metadata serve two quite different purposes. First, when generating schema, the foreign key element identifies foreign keys to be generated. Second, when using the database, foreign key elements identify foreign keys that are assumed to exist in the database. This is important for the runtime to properly order insert, update, and delete statements to avoid constraint violations. A foreign-key element can be contained by a field, element, key, value, or join element, if all of the columns mapped are to be part of the same foreign key. A foreign-key element can be contained within a class element. In this case, the column elements are mapped elsewhere, and the column elements contained in the foreign-key element have only the column name.
| Field Summary | |
|---|---|
protected boolean |
deferred
The deferred attribute specifies whether the foreign key constraint is defined to be checked only at commit time. |
protected ForeignKeyAction |
deleteAction
Foreign keys represent a consistency constraint in the database that must be maintained. |
protected boolean |
unique
The unique attribute specifies whether the foreign key constraint is defined to be a unique constraint as well. |
protected ForeignKeyAction |
updateAction
Foreign keys represent a consistency constraint in the database that must be maintained. |
| Fields inherited from class org.jpox.metadata.AbstractConstraintMetaData |
|---|
columnMetaData, columns, memberMetaData, members, name, table |
| Fields inherited from class org.jpox.metadata.MetaData |
|---|
extensions, JPOX_VENDOR_NAME, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent |
| Constructor Summary | |
|---|---|
ForeignKeyMetaData(ForeignKeyMetaData fkmd)
Constructor to create a copy of the passed metadata using the provided parent. |
|
ForeignKeyMetaData(java.lang.String name,
java.lang.String table,
java.lang.String unique,
java.lang.String deferred,
java.lang.String delete_action,
java.lang.String update_action)
Constructor. |
|
| Method Summary | |
|---|---|
ForeignKeyAction |
getDeleteAction()
Accessor for the delete action |
ForeignKeyAction |
getUpdateAction()
Accessor for the update action |
void |
initialise()
Method to initialise the object, setting up all internal arrays. |
boolean |
isDeferred()
Accessor for whether the FK is deferred |
boolean |
isUnique()
Accessor for the unique flag |
java.lang.String |
toString(java.lang.String prefix,
java.lang.String indent)
Returns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file. |
| Methods inherited from class org.jpox.metadata.AbstractConstraintMetaData |
|---|
addColumn, addMember, getColumnMetaData, getMemberMetaData, getName, getNumberOfColumns, getNumberOfMembers, getTable, setName |
| Methods inherited from class org.jpox.metadata.MetaData |
|---|
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, populate, removeExtension, setInitialised, setParent, setPopulated, setUsed, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jpox.metadata.ColumnMetaDataContainer |
|---|
addColumn, getColumnMetaData |
| Field Detail |
|---|
protected boolean unique
protected boolean deferred
protected ForeignKeyAction deleteAction
protected ForeignKeyAction updateAction
| Constructor Detail |
|---|
public ForeignKeyMetaData(ForeignKeyMetaData fkmd)
fkmd - The metadata to copy
public ForeignKeyMetaData(java.lang.String name,
java.lang.String table,
java.lang.String unique,
java.lang.String deferred,
java.lang.String delete_action,
java.lang.String update_action)
name - Name of the foreign keytable - Table to apply the FK tounique - Whether the key is uniquedeferred - Whether the key is deferreddelete_action - Action to perform on deletionupdate_action - Action to perform on update| Method Detail |
|---|
public void initialise()
initialise in class MetaDatapublic final boolean isDeferred()
public final ForeignKeyAction getDeleteAction()
public final boolean isUnique()
public final ForeignKeyAction getUpdateAction()
public java.lang.String toString(java.lang.String prefix,
java.lang.String indent)
toString in class MetaDataprefix - prefix stringindent - indent string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||