Package org.datanucleus.store.rdbms.key
Class Key
java.lang.Object
org.datanucleus.store.rdbms.key.Key
- Direct Known Subclasses:
ColumnOrderedKey
,ForeignKey
,PrimaryKey
Abstract representation of a Key to a table.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Class to add a column to the keyprotected void
Utility to assert if the column is for a different table.boolean
Equality operator.Accessor for the column liststatic String
getColumnList
(List<Column> cols) Method to return the list of columns which the key applies to.Accessor for the columns that the key relates to.getName()
Accessor for the key name.int
Accessor for the number of columns.getTable()
Accessor for the tableint
hashCode()
Hashcode operator.void
Sets a column in a specified positionseq
for this index.protected static void
setListMinimumSize
(List<?> list, int size) void
Mutator for the key name.
-
Field Details
-
name
Name of the key. -
table
Table that the key applies to. -
columns
Columns that the key relates to.
-
-
Constructor Details
-
Key
Constructor.- Parameters:
table
- The table
-
-
Method Details
-
setName
Mutator for the key name.- Parameters:
name
- The key name
-
getName
Accessor for the key name.- Returns:
- Key name
-
getTable
Accessor for the table- Returns:
- table
-
getColumns
Accessor for the columns that the key relates to.- Returns:
- the List of columns.
-
getColumnList
Accessor for the column list- Returns:
- The column list
-
getNumberOfColumns
public int getNumberOfColumns()Accessor for the number of columns.- Returns:
- The number of columns.
-
addColumn
Class to add a column to the key- Parameters:
col
- The column to add
-
setColumn
Sets a column in a specified positionseq
for this index.- Parameters:
seq
- the specified position for thecol
col
- the Column
-
assertSameDatastoreObject
Utility to assert if the column is for a different table.- Parameters:
col
- The column to compare with
-
hashCode
public int hashCode()Hashcode operator. -
equals
Equality operator. -
setListMinimumSize
-
getColumnList
Method to return the list of columns which the key applies to.- Parameters:
cols
- The columns.- Returns:
- The column list.
-