public class CandidateKey extends Object
Modifier and Type | Field and Description |
---|---|
protected List<Column> |
columns
Columns that the key relates to.
|
protected String |
name
Name of the key.
|
protected Table |
table
Table that the key applies to.
|
Constructor and Description |
---|
CandidateKey(Table table)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addColumn(Column col)
Class to add a column to the key
|
protected void |
assertSameDatastoreObject(Column 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<Column> |
getColumns()
Accessor for the columns that the key relates to.
|
String |
getName()
Accessor for the key name.
|
Table |
getTable()
Accessor for the table
|
int |
hashCode()
Hashcode operator.
|
void |
setColumn(int seq,
Column col)
Mutator for the column spec, to add/change a column.
|
protected static void |
setMinSize(List list,
int size) |
void |
setName(String name)
Mutator for the key name.
|
int |
size()
Accessor for the size.
|
boolean |
startsWith(org.datanucleus.store.rdbms.key.Key key)
Check if this starts with the same columns specified in
key . |
String |
toString()
Stringify method.
|
protected String name
protected Table table
public CandidateKey(Table table)
table
- Table to apply this key topublic void setColumn(int seq, Column col)
seq
- Sequence number of the columncol
- The columnpublic int size()
public boolean equals(Object obj)
obj
- Object to compare againstpublic int hashCode()
public String toString()
public String getName()
public Table getTable()
public List<Column> getColumns()
public String getColumnList()
public void addColumn(Column 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)key
public void setName(String name)
name
- The key nameprotected void assertSameDatastoreObject(Column col)
col
- The column to compare withprotected static void setMinSize(List list, int size)
public static String getColumnList(Collection cols)
cols
- The columns.Copyright © 2017. All rights reserved.