MySQL 5.6.14 Source Code Document
|
Public Member Functions | |
IndexHandlerImpl (DomainTypeHandler<?> domainTypeHandler, Dictionary dictionary, Index storeIndex, String[] columnNames) | |
IndexHandlerImpl (DomainTypeHandler<?> domainTypeHandler, Dictionary dictionary, String indexName, AbstractDomainFieldHandlerImpl fmd) | |
CandidateIndexImpl | toCandidateIndexImpl () |
String | toString () |
void | setDomainFieldHandlerFor (int i, AbstractDomainFieldHandlerImpl fmd) |
String[] | getColumnNames () |
void | assertAllColumnsHaveFields () |
boolean | isUsable () |
String | getReason () |
String | getIndexName () |
Protected Member Functions | |
boolean | isUnique (Index storeIndex) |
Index | getIndex (Dictionary dictionary, String tableName, String indexName) |
Protected Attributes | |
String | className |
String | tableName |
Index | storeIndex |
boolean | unique = true |
AbstractDomainFieldHandlerImpl[] | fields |
final String[] | columnNames |
IndexHandlerImpl represents indices defined in the cluster. One instance of this class represents either an ordered index or a unique hash index. So a unique index that results in creating two indices will be represented by two instances of IndexHandlerImpl. The Dictionary access to unique indexes requires the suffix "$unique" to be appended to the name, but the NdbTransaction access requires that the suffix not be used. This class is responsible for mediating the difference.
The simple case is one index => one field => one column.
For ClusterJ and JPA, indexes can also support multiple columns, with each column mapped to one field. This pattern is used for compound primary keys. In this case, there is one instance of IndexHandlerImpl for each index, and the columnNames and fields have the same cardinality. This is one index => multiple (one field => one column)
For JPA, indexes can also support one field mapped to multiple columns, which is the pattern used for compound foreign keys to represent relationships. In this case, there is a single instance of IndexHandlerImpl for each index. The columnNames lists the columns covered by the index, and there is one field. The field manages an instance of the object id class for the relationship. This is one index => one field => multiple columns.
Definition at line 56 of file IndexHandlerImpl.java.
|
inline |
Construct an IndexHandlerImpl from an index name and column names. This constructor is used when the column handlers are not yet known.
domainTypeHandler | the domain type handler |
dictionary | the dictionary for validation |
storeIndex | the store index |
columnNames | the column names for the index |
Definition at line 101 of file IndexHandlerImpl.java.
|
inline |
Construct an IndexHandlerImpl from an index declared on a field. There may be more than one column in the index; the columns are taken from the columns mapped by the field.
domainTypeHandler | the domain type handler |
dictionary | the Dictionary |
indexName | the index name |
fmd | the DomainFieldHandlerImpl that corresponds to the column |
Definition at line 123 of file IndexHandlerImpl.java.
|
inline |
Validate that all columnNames have fields.
Definition at line 180 of file IndexHandlerImpl.java.
|
inline |
Accessor for columnNames.
Definition at line 173 of file IndexHandlerImpl.java.
|
inline |
Set the DomainFieldHandlerImpl once it's known.
i | the index into the fields array |
fmd | the DomainFieldHandlerImpl for the corresponding column |
Definition at line 167 of file IndexHandlerImpl.java.
|
inline |
Create a CandidateIndexImpl from this IndexHandlerImpl. The CandidateIndexImpl is used to decide on the strategy for a query.
Definition at line 139 of file IndexHandlerImpl.java.
|
protected |
My class
Definition at line 68 of file IndexHandlerImpl.java.
|
protected |
The columnNames in the index.
Definition at line 86 of file IndexHandlerImpl.java.
|
protected |
The fields (corresponding to the columnNames) in the index.
Definition at line 83 of file IndexHandlerImpl.java.
|
protected |
The store Index of this index.
Definition at line 77 of file IndexHandlerImpl.java.
|
protected |
My table
Definition at line 71 of file IndexHandlerImpl.java.
|
protected |
This is a unique index?
Definition at line 80 of file IndexHandlerImpl.java.