|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.triactive.jdo.store.sql.QualifiedName com.triactive.jdo.store.sql.IndexName
An SQL index name.
An IndexName is a type of QualifiedName
naming an SQL database
index.
Index names in TJDO are generated using a suffix convention based on their type, unique (_Un) vs. non-unique (_Nn).
Field Summary | |
static int |
MAX_INDICES
The maximum number of indices allowed. |
static int |
MAX_SUFFIX_LENGTH
The maximum length in characters reserved at the end of index names for suffixes used to indicate the type of index. |
Fields inherited from class com.triactive.jdo.store.sql.QualifiedName |
identifier, schemaName |
Constructor Summary | |
IndexName(DatabaseAdapter dba,
SchemaName schemaName,
java.lang.String identifier)
Constructs an index name. |
|
IndexName(DatabaseAdapter dba,
java.lang.String identifier)
Constructs an index name. |
Method Summary | |
static IndexName |
forTable(BaseTable table,
boolean isUnique,
int seq)
Generates a new index name. |
boolean |
isForTable(BaseTable table)
Tests if this index name is for an index on the specified table. |
Methods inherited from class com.triactive.jdo.store.sql.QualifiedName |
effectiveCatalogName, effectiveSchemaName, equals, fullyQualified, getIdentifier, getSchemaName, hashCode, intern, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MAX_SUFFIX_LENGTH
public static final int MAX_INDICES
Constructor Detail |
public IndexName(DatabaseAdapter dba, java.lang.String identifier)
dba
- a database adapter for the relevant databaseidentifier
- the SQL identifier value as a stringpublic IndexName(DatabaseAdapter dba, SchemaName schemaName, java.lang.String identifier)
dba
- a database adapter for the relevant databaseschemaName
- the schema name part of the index name, or null
if the
name is not schema-qualifiedidentifier
- the SQL identifier value as a stringMethod Detail |
public boolean isForTable(BaseTable table)
Note: the current implementation of this method is simplistic and may return false positives.
table
- The base table to test.
true
if this index name is for an index on
table, false
otherwise.public static IndexName forTable(BaseTable table, boolean isUnique, int seq)
The table name is used as the base of the new index name.
The table name identifier is first truncated if necessary to reserve
MAX_SUFFIX_LENGTH
characters for a suffix.
Then _Un or _Nn is appended,
depending on whether the index isUnique or not, and where
n is a character from [0-9A-Z] representing the given
seq parameter.
If the specified table's name is schema-qualified then the index name will be schema-qualified.
table
- The base table for the named index.isUnique
- true
if a unique index is being namedseq
- The number of the index for this table. By convention, should start
at 1.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |