MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mysql.clusterj.core.metadata.IndexHandlerImpl Class Reference
Collaboration diagram for com.mysql.clusterj.core.metadata.IndexHandlerImpl:

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

Detailed Description

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.

Constructor & Destructor Documentation

com.mysql.clusterj.core.metadata.IndexHandlerImpl.IndexHandlerImpl ( DomainTypeHandler<?>  domainTypeHandler,
Dictionary  dictionary,
Index  storeIndex,
String[]  columnNames 
)
inline

Construct an IndexHandlerImpl from an index name and column names. This constructor is used when the column handlers are not yet known.

Parameters
domainTypeHandlerthe domain type handler
dictionarythe dictionary for validation
storeIndexthe store index
columnNamesthe column names for the index

Definition at line 101 of file IndexHandlerImpl.java.

Here is the call graph for this function:

com.mysql.clusterj.core.metadata.IndexHandlerImpl.IndexHandlerImpl ( DomainTypeHandler<?>  domainTypeHandler,
Dictionary  dictionary,
String  indexName,
AbstractDomainFieldHandlerImpl  fmd 
)
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.

Parameters
domainTypeHandlerthe domain type handler
dictionarythe Dictionary
indexNamethe index name
fmdthe DomainFieldHandlerImpl that corresponds to the column

Definition at line 123 of file IndexHandlerImpl.java.

Member Function Documentation

void com.mysql.clusterj.core.metadata.IndexHandlerImpl.assertAllColumnsHaveFields ( )
inline

Validate that all columnNames have fields.

Definition at line 180 of file IndexHandlerImpl.java.

Here is the call graph for this function:

String [] com.mysql.clusterj.core.metadata.IndexHandlerImpl.getColumnNames ( )
inline

Accessor for columnNames.

Definition at line 173 of file IndexHandlerImpl.java.

Here is the caller graph for this function:

void com.mysql.clusterj.core.metadata.IndexHandlerImpl.setDomainFieldHandlerFor ( int  i,
AbstractDomainFieldHandlerImpl  fmd 
)
inline

Set the DomainFieldHandlerImpl once it's known.

Parameters
ithe index into the fields array
fmdthe DomainFieldHandlerImpl for the corresponding column

Definition at line 167 of file IndexHandlerImpl.java.

Here is the caller graph for this function:

CandidateIndexImpl com.mysql.clusterj.core.metadata.IndexHandlerImpl.toCandidateIndexImpl ( )
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.

Here is the call graph for this function:

Member Data Documentation

String com.mysql.clusterj.core.metadata.IndexHandlerImpl.className
protected

My class

Definition at line 68 of file IndexHandlerImpl.java.

final String [] com.mysql.clusterj.core.metadata.IndexHandlerImpl.columnNames
protected

The columnNames in the index.

Definition at line 86 of file IndexHandlerImpl.java.

AbstractDomainFieldHandlerImpl [] com.mysql.clusterj.core.metadata.IndexHandlerImpl.fields
protected

The fields (corresponding to the columnNames) in the index.

Definition at line 83 of file IndexHandlerImpl.java.

Index com.mysql.clusterj.core.metadata.IndexHandlerImpl.storeIndex
protected

The store Index of this index.

Definition at line 77 of file IndexHandlerImpl.java.

String com.mysql.clusterj.core.metadata.IndexHandlerImpl.tableName
protected

My table

Definition at line 71 of file IndexHandlerImpl.java.

boolean com.mysql.clusterj.core.metadata.IndexHandlerImpl.unique = true
protected

This is a unique index?

Definition at line 80 of file IndexHandlerImpl.java.


The documentation for this class was generated from the following file: