Package org.datanucleus.store.rdbms.key
Class ColumnOrderedKey
- java.lang.Object
-
- org.datanucleus.store.rdbms.key.ColumnOrderedKey
-
- Direct Known Subclasses:
CandidateKey,Index
public abstract class ColumnOrderedKey extends Object
Representation of a key that has columns with specified ordering (ascending/descending) for each column (if required).
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Boolean>columnOrderingColumn ordering.protected List<Column>columnsColumns that the key relates to.protected Map<String,String>extensionsprotected StringnameName of the key.protected TabletableTable that the key applies to.
-
Constructor Summary
Constructors Constructor Description ColumnOrderedKey(Table table, Map<String,String> extensions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(Column col)Class to add a column to the keyprotected voidassertSameDatastoreObject(Column col)Utility to assert if the column is for a different table.booleanequals(Object obj)Equality operator.StringgetColumnList()Accessor for the column listStringgetColumnList(boolean includeOrdering)Method to return the list of columns which the key applies to.static StringgetColumnList(List<Column> 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.StringgetName()Accessor for the key name.intgetNumberOfColumns()Accessor for the number of columns.TablegetTable()Accessor for the tableStringgetValueForExtension(String key)inthashCode()Hashcode operator.voidsetColumn(int seq, Column col)Sets a column in a specified positionseqfor this index.voidsetColumnOrdering(String ordering)protected static voidsetListMinimumSize(List list, int size)voidsetName(String name)Mutator for the key name.
-
-
-
Method Detail
-
addColumn
public void addColumn(Column col)
Class to add a column to the key- Parameters:
col- The column to add
-
setColumnOrdering
public void setColumnOrdering(String ordering)
-
setColumn
public void setColumn(int seq, Column col)Sets a column in a specified positionseqfor this index.- Parameters:
seq- the specified position for thecolcol- the Column
-
getColumnList
public String getColumnList(boolean includeOrdering)
Method to return the list of columns which the key applies to.- Parameters:
includeOrdering- Whether to include ordering in the column list when it is specified- Returns:
- The column list.
-
setName
public void setName(String name)
Mutator for the key name.- Parameters:
name- The key name
-
getName
public String getName()
Accessor for the key name.- Returns:
- Key name
-
getTable
public Table getTable()
Accessor for the table- Returns:
- table
-
getColumns
public List<Column> getColumns()
Accessor for the columns that the key relates to.- Returns:
- the List of columns.
-
getColumnList
public String 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.
-
assertSameDatastoreObject
protected void assertSameDatastoreObject(Column col)
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
public boolean equals(Object obj)
Equality operator.
-
setListMinimumSize
protected static void setListMinimumSize(List list, int size)
-
-