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