|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.metadata.MetaData
org.datanucleus.metadata.AbstractConstraintMetaData
org.datanucleus.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.datanucleus.metadata.AbstractConstraintMetaData |
|---|
columnMetaData, columns, memberMetaData, members, name, table |
| Fields inherited from class org.datanucleus.metadata.MetaData |
|---|
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD |
| Constructor Summary | |
|---|---|
ForeignKeyMetaData()
Default constructor. |
|
ForeignKeyMetaData(ForeignKeyMetaData fkmd)
Constructor to create a copy of the passed metadata using the provided parent. |
|
| Method Summary | |
|---|---|
ForeignKeyAction |
getDeleteAction()
|
java.lang.String |
getName()
|
java.lang.String |
getTable()
|
ForeignKeyAction |
getUpdateAction()
|
boolean |
isDeferred()
|
boolean |
isUnique()
|
ForeignKeyMetaData |
setDeferred(boolean deferred)
|
ForeignKeyMetaData |
setDeferred(java.lang.String deferred)
|
void |
setDeleteAction(ForeignKeyAction deleteAction)
|
void |
setName(java.lang.String name)
|
void |
setTable(java.lang.String table)
|
ForeignKeyMetaData |
setUnique(boolean unique)
|
ForeignKeyMetaData |
setUnique(java.lang.String unique)
|
ForeignKeyMetaData |
setUpdateAction(ForeignKeyAction updateAction)
|
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.datanucleus.metadata.AbstractConstraintMetaData |
|---|
addColumn, addMember, getColumnMetaData, getMemberMetaData, getNumberOfColumns, getNumberOfMembers, initialise, newColumnMetaData, newFieldMetaData, newPropertyMetaData |
| Methods inherited from class org.datanucleus.metadata.MetaData |
|---|
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.datanucleus.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 copypublic ForeignKeyMetaData()
| Method Detail |
|---|
public final java.lang.String getName()
public void setName(java.lang.String name)
public final java.lang.String getTable()
public void setTable(java.lang.String table)
public final boolean isDeferred()
public ForeignKeyMetaData setDeferred(boolean deferred)
public ForeignKeyMetaData setDeferred(java.lang.String deferred)
public final ForeignKeyAction getDeleteAction()
public void setDeleteAction(ForeignKeyAction deleteAction)
public final boolean isUnique()
public ForeignKeyMetaData setUnique(boolean unique)
public ForeignKeyMetaData setUnique(java.lang.String unique)
public final ForeignKeyAction getUpdateAction()
public ForeignKeyMetaData setUpdateAction(ForeignKeyAction updateAction)
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 | |||||||||