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
public class JPOXIdentifierFactory extends DNIdentifierFactory
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
Fields Modifier and Type Field Description private static int
HASH_RANGE
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
Constructors Constructor Description JPOXIdentifierFactory(DatastoreAdapter dba, org.datanucleus.ClassLoaderResolver clr, java.util.Map props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
truncate(java.lang.String identifier, int length)
Method to truncate an identifier to fit within the specified identifier length.-
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 Detail
-
HASH_RANGE
private static final int HASH_RANGE
Range to use for creating hased ending when truncating identifiers.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JPOXIdentifierFactory
public JPOXIdentifierFactory(DatastoreAdapter dba, org.datanucleus.ClassLoaderResolver clr, java.util.Map props)
-
-
Method Detail
-
truncate
protected java.lang.String truncate(java.lang.String identifier, int length)
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.
-
-