| java.lang.Object org.jpox.metadata.MetaData org.jpox.metadata.AbstractConstraintMetaData org.jpox.metadata.ForeignKeyMetaData
ForeignKeyMetaData | public class ForeignKeyMetaData extends AbstractConstraintMetaData implements ColumnMetaDataContainer(Code) | | 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.
since: 1.1 version: $Revision: 1.21 $ |
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. |
deferred | protected boolean deferred(Code) | | The deferred attribute specifies whether the foreign key constraint is
defined to be checked only at commit time.
|
deleteAction | protected ForeignKeyAction deleteAction(Code) | | Foreign keys represent a consistency constraint in the database that must
be maintained. The user can specify by the value of the delete-action
attribute what happens if the target row of a foreign key is deleted.
|
unique | protected boolean unique(Code) | | The unique attribute specifies whether the foreign key constraint is
defined to be a unique constraint as well. This is most often used with
one-to-one mappings.
|
updateAction | protected ForeignKeyAction updateAction(Code) | | Foreign keys represent a consistency constraint in the database that must
be maintained. The user can specify by the update-action attribute what
happens if the target row of a foreign key is updated.
|
ForeignKeyMetaData | public ForeignKeyMetaData(ForeignKeyMetaData fkmd)(Code) | | Constructor to create a copy of the passed metadata using the provided parent.
Parameters: fkmd - The metadata to copy |
ForeignKeyMetaData | public ForeignKeyMetaData(String name, String table, String unique, String deferred, String delete_action, String update_action)(Code) | | Constructor.
Parameters: name - Name of the foreign key Parameters: table - Table to apply the FK to Parameters: unique - Whether the key is unique Parameters: deferred - Whether the key is deferred Parameters: delete_action - Action to perform on deletion Parameters: update_action - Action to perform on update |
getDeleteAction | final public ForeignKeyAction getDeleteAction()(Code) | | Accessor for the delete action
Returns the deleteAction. |
getUpdateAction | final public ForeignKeyAction getUpdateAction()(Code) | | Accessor for the update action
Returns the updateAction. |
initialise | public void initialise()(Code) | | Method to initialise the object, setting up all internal arrays.
Initialises all sub-objects.
|
isDeferred | final public boolean isDeferred()(Code) | | Accessor for whether the FK is deferred
Returns the deferred. |
isUnique | final public boolean isUnique()(Code) | | Accessor for the unique flag
Returns the unique. |
toString | public String toString(String prefix, String indent)(Code) | | Returns a string representation of the object using a prefix
This can be used as part of a facility to output a MetaData file.
Parameters: prefix - prefix string Parameters: indent - indent string a string representation of the object. |
|
|