Class JPOXIdentifierFactory
java.lang.Object
org.datanucleus.store.rdbms.identifier.AbstractIdentifierFactory
org.datanucleus.store.rdbms.identifier.DNIdentifierFactory
org.datanucleus.store.rdbms.identifier.JPOXIdentifierFactory
- All Implemented Interfaces:
IdentifierFactory
Factory that creates immutable instances of DatastoreIdentifier for mapped datastores.
Provides the "JPOX" naming strategy like with DNIdentifierFactory except this uses a consistent hashing process to match JPOX.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
Range to use for creating hased ending when truncating identifiers.Fields inherited from class org.datanucleus.store.rdbms.identifier.DNIdentifierFactory
tablePrefix, tableSuffix
Fields inherited from class org.datanucleus.store.rdbms.identifier.AbstractIdentifierFactory
candidates, CASE_LOWER, CASE_PRESERVE, CASE_UPPER, clr, columns, dba, defaultCatalogName, defaultSchemaName, foreignkeys, indexes, namingCase, namingFactory, primarykeys, quoteString, references, sequences, tables, wordSeparator
Fields inherited from interface org.datanucleus.store.rdbms.identifier.IdentifierFactory
PROPERTY_DEFAULT_CATALOG, PROPERTY_DEFAULT_SCHEMA, PROPERTY_NAMING_FACTORY, PROPERTY_REQUIRED_CASE, PROPERTY_TABLE_PREFIX, PROPERTY_TABLE_SUFFIX, PROPERTY_WORD_SEPARATOR
-
Constructor Summary
ConstructorsConstructorDescriptionJPOXIdentifierFactory
(DatastoreAdapter dba, org.datanucleus.ClassLoaderResolver clr, Map props) -
Method Summary
Methods inherited from class org.datanucleus.store.rdbms.identifier.DNIdentifierFactory
generateIdentifierNameForJavaName, getColumnIdentifierSuffix, newAdapterIndexFieldIdentifier, newDiscriminatorFieldIdentifier, newForeignKeyFieldIdentifier, newIndexFieldIdentifier, newJoinTableFieldIdentifier, newReferenceFieldIdentifier, newTableIdentifier, newTableIdentifier, newVersionFieldIdentifier
Methods inherited from class org.datanucleus.store.rdbms.identifier.AbstractIdentifierFactory
getDatastoreAdapter, getIdentifierInAdapterCase, getIdentifierNamePartsFromName, getIdentifierTruncatedToAdapterColumnLength, getNamingCase, getWordSeparator, newCandidateKeyIdentifier, newColumnIdentifier, newColumnIdentifier, newForeignKeyIdentifier, newIdentifier, newIdentifier, newIndexIdentifier, newPrimaryKeyIdentifier, newSequenceIdentifier, newTableIdentifier, newTableIdentifier, setCatalogSchemaForTable
-
Field Details
-
HASH_RANGE
private static final int HASH_RANGERange to use for creating hased ending when truncating identifiers.- See Also:
-
-
Constructor Details
-
JPOXIdentifierFactory
public JPOXIdentifierFactory(DatastoreAdapter dba, org.datanucleus.ClassLoaderResolver clr, Map props)
-
-
Method Details
-
truncate
Method to truncate an identifier to fit within the specified identifier length. If truncation is necessary will use a 2 char hashcode (at the end) to attempt to create uniqueness.- Overrides:
truncate
in classAbstractIdentifierFactory
- Parameters:
identifier
- The identifierlength
- The (max) length to use- Returns:
- The truncated identifier.
-