|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.key.CandidateKey
org.datanucleus.store.rdbms.key.PrimaryKey
public class PrimaryKey
Representation of the primary key of a table.
| 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 | |
|---|---|
PrimaryKey(org.datanucleus.store.mapped.DatastoreContainerObject table)
Creates a primary key. |
|
| Method Summary | |
|---|---|
void |
addDatastoreField(org.datanucleus.store.mapped.DatastoreField col)
Class to add a column to the key |
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 |
String |
getName()
Accessor for the key name. |
int |
hashCode()
Hashcode operator. |
protected static void |
setMinSize(List list,
int size)
|
void |
setName(String name)
Mutator for the key name. |
boolean |
startsWith(org.datanucleus.store.rdbms.key.Key key)
Check if this starts with the same columns specified in key. |
String |
toString()
Stringifier method. |
| Methods inherited from class org.datanucleus.store.rdbms.key.CandidateKey |
|---|
setDatastoreField, size |
| 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 PrimaryKey(org.datanucleus.store.mapped.DatastoreContainerObject table)
table - Table that this is the PK for| Method Detail |
|---|
public boolean equals(Object obj)
equals in class CandidateKeyobj - The object to compare against
public String toString()
toString in class CandidateKeypublic 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 withpublic int hashCode()
hashCode in class Object
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 | |||||||||