Package org.datanucleus.store.rdbms.key
Class ForeignKey
java.lang.Object
org.datanucleus.store.rdbms.key.Key
org.datanucleus.store.rdbms.key.ForeignKey
Representation of a foreign key to another table.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum representing an action on the FK. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DatastoreAdapter
private ForeignKey.FKAction
private String
private boolean
private DatastoreClass
private ForeignKey.FKAction
-
Constructor Summary
ConstructorsConstructorDescriptionForeignKey
(DatastoreAdapter dba, boolean initiallyDeferred) Constructor.ForeignKey
(JavaTypeMapping mapping, DatastoreAdapter dba, DatastoreClass refTable, boolean initiallyDeferred) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method to add a Column.boolean
Equality operator.int
hashCode()
Hashcode operator.boolean
isEqual
(ForeignKey fk) void
Set the column for the specified positionseq
void
setDeleteAction
(ForeignKey.FKAction deleteAction) Mutator for deleteAction.void
setForMetaData
(org.datanucleus.metadata.ForeignKeyMetaData fkmd) Convenience mutator for setting the specification based on MetaDatavoid
setUpdateAction
(ForeignKey.FKAction updateAction) Mutator for updateAction.toString()
Stringify method.Methods inherited from class org.datanucleus.store.rdbms.key.Key
addColumn, assertSameDatastoreObject, getColumnList, getColumnList, getColumns, getName, getNumberOfColumns, getTable, setColumn, setListMinimumSize, setName
-
Field Details
-
dba
-
initiallyDeferred
private boolean initiallyDeferred -
refTable
-
updateAction
-
deleteAction
-
refColumns
-
foreignKeyDefinition
-
-
Constructor Details
-
ForeignKey
Constructor.- Parameters:
dba
- Datastore adapterinitiallyDeferred
- Whether the constraints are deferred
-
ForeignKey
public ForeignKey(JavaTypeMapping mapping, DatastoreAdapter dba, DatastoreClass refTable, boolean initiallyDeferred) Constructor.- Parameters:
mapping
- The type mapping for this Foreign-key fielddba
- Datastore adapterrefTable
- Referred to tableinitiallyDeferred
- Whether they are deferred
-
-
Method Details
-
setForMetaData
public void setForMetaData(org.datanucleus.metadata.ForeignKeyMetaData fkmd) Convenience mutator for setting the specification based on MetaData- Parameters:
fkmd
- ForeignKey MetaData definition
-
setDeleteAction
Mutator for deleteAction.- Parameters:
deleteAction
- The deleteAction to set.
-
setUpdateAction
Mutator for updateAction.- Parameters:
updateAction
- The updateAction to set.
-
addColumn
Method to add a Column.- Parameters:
col
- The column to addrefCol
- The column to reference
-
getRefTable
-
getRefColumnList
-
setColumn
Set the column for the specified positionseq
- Parameters:
seq
- the specified positioncol
- the columnrefCol
- the foreign (refered) column
-
hashCode
public int hashCode()Description copied from class:Key
Hashcode operator. -
equals
Description copied from class:Key
Equality operator. -
isEqual
-
toString
Stringify method. Generates the foreign key statement ready for use in an SQL call.
-