|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.key.ForeignKey
public class ForeignKey
Representation of a foreign key to another table.
| Nested Class Summary | |
|---|---|
static class |
ForeignKey.FKAction
Enum representing an action on the FK. |
| Field Summary | |
|---|---|
protected List<org.datanucleus.store.mapped.DatastoreField> |
columns
Columns that the key relates to. |
protected String |
name
Name of the key. |
protected org.datanucleus.store.mapped.DatastoreContainerObject |
table
Table that the key applies to. |
| Constructor Summary | |
|---|---|
ForeignKey(boolean initiallyDeferred)
Constructor. |
|
ForeignKey(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
org.datanucleus.store.mapped.DatastoreAdapter dba,
org.datanucleus.store.mapped.DatastoreClass refTable,
boolean initiallyDeferred)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addDatastoreField(org.datanucleus.store.mapped.DatastoreField col)
Class to add a column to the key |
void |
addDatastoreField(org.datanucleus.store.mapped.DatastoreField col,
org.datanucleus.store.mapped.DatastoreField refCol)
Method to add a Column. |
protected void |
assertSameDatastoreObject(org.datanucleus.store.mapped.DatastoreField col)
Utility to assert if the column is for a different table. |
boolean |
equals(Object obj)
Equality operator. |
String |
getColumnList()
Accessor for the column list |
static String |
getColumnList(Collection cols)
Method to return the list of columns which the key applies to. |
List<org.datanucleus.store.mapped.DatastoreField> |
getColumns()
Accessor for the columns that the key relates to. |
org.datanucleus.store.mapped.DatastoreContainerObject |
getDatastoreContainerObject()
Accessor for the table |
ForeignKey.FKAction |
getDeleteAction()
Accessor for deleteAction. |
String |
getName()
Accessor for the key name. |
org.datanucleus.store.mapped.DatastoreContainerObject |
getReferredTable()
|
ForeignKey.FKAction |
getUpdateAction()
Accessor for updateAction. |
int |
hashCode()
Hashcode operator. |
void |
setDatastoreField(int seq,
org.datanucleus.store.mapped.DatastoreField col,
org.datanucleus.store.mapped.DatastoreField refCol)
Set the datastore field for the specified position seq |
void |
setDeleteAction(ForeignKey.FKAction deleteAction)
Mutator for deleteAction. |
void |
setForMetaData(org.datanucleus.metadata.ForeignKeyMetaData fkmd)
Convenience mutator for setting the specification based on MetaData |
protected static void |
setMinSize(List list,
int size)
|
void |
setName(String name)
Mutator for the key name. |
void |
setUpdateAction(ForeignKey.FKAction updateAction)
Mutator for updateAction. |
boolean |
startsWith(org.datanucleus.store.rdbms.key.Key key)
Check if this starts with the same columns specified in key. |
String |
toString()
Stringify method. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String name
protected org.datanucleus.store.mapped.DatastoreContainerObject table
protected List<org.datanucleus.store.mapped.DatastoreField> columns
| Constructor Detail |
|---|
public ForeignKey(boolean initiallyDeferred)
initiallyDeferred - Whether the constraints are deferred
public ForeignKey(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
org.datanucleus.store.mapped.DatastoreAdapter dba,
org.datanucleus.store.mapped.DatastoreClass refTable,
boolean initiallyDeferred)
mapping - The type mapping for this Foreign-key fielddba - Datastore adapterrefTable - Referred to tableinitiallyDeferred - Whether they are deferred| Method Detail |
|---|
public void setForMetaData(org.datanucleus.metadata.ForeignKeyMetaData fkmd)
fkmd - ForeignKey MetaData definitionpublic org.datanucleus.store.mapped.DatastoreContainerObject getReferredTable()
public ForeignKey.FKAction getDeleteAction()
public void setDeleteAction(ForeignKey.FKAction deleteAction)
deleteAction - The deleteAction to set.public ForeignKey.FKAction getUpdateAction()
public void setUpdateAction(ForeignKey.FKAction updateAction)
updateAction - The updateAction to set.
public void addDatastoreField(org.datanucleus.store.mapped.DatastoreField col,
org.datanucleus.store.mapped.DatastoreField refCol)
col - The column to addrefCol - The column to reference
public void setDatastoreField(int seq,
org.datanucleus.store.mapped.DatastoreField col,
org.datanucleus.store.mapped.DatastoreField refCol)
seq
seq - the specified positioncol - the datastore fieldrefCol - the foreign (refered) datastore fieldpublic int hashCode()
public boolean equals(Object obj)
obj - Object to compare against
public String toString()
toString in class Objectpublic String getName()
public org.datanucleus.store.mapped.DatastoreContainerObject getDatastoreContainerObject()
public List<org.datanucleus.store.mapped.DatastoreField> getColumns()
public String getColumnList()
public void addDatastoreField(org.datanucleus.store.mapped.DatastoreField col)
col - The column to addpublic boolean startsWith(org.datanucleus.store.rdbms.key.Key key)
key.
key - the Key (may be multiple number of columns)
keypublic void setName(String name)
name - The key nameprotected void assertSameDatastoreObject(org.datanucleus.store.mapped.DatastoreField col)
col - The column to compare with
protected static void setMinSize(List list,
int size)
public static String getColumnList(Collection cols)
cols - The columns.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||