public interface IdentifierFactory
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_DEFAULT_CATALOG |
static String |
PROPERTY_DEFAULT_SCHEMA |
static String |
PROPERTY_NAMING_FACTORY |
static String |
PROPERTY_REQUIRED_CASE |
static String |
PROPERTY_TABLE_PREFIX |
static String |
PROPERTY_TABLE_SUFFIX |
static String |
PROPERTY_WORD_SEPARATOR |
Modifier and Type | Method and Description |
---|---|
DatastoreAdapter |
getDatastoreAdapter()
Accessor for the datastore adapter that we are creating identifiers for.
|
String |
getIdentifierInAdapterCase(String identifier)
Accessor for an identifier for use in the datastore adapter
|
String |
getIdentifierTruncatedToAdapterColumnLength(String identifier)
Method to truncate the provided identifier as required to the datastore adapter column length (if required)
|
org.datanucleus.store.schema.naming.NamingCase |
getNamingCase()
Accessor for the identifier case being used.
|
DatastoreIdentifier |
newAdapterIndexFieldIdentifier()
Method to return an identifier for an adapter index column.
|
DatastoreIdentifier |
newCandidateKeyIdentifier(Table table,
int seq)
Method to generate an identifier for a candidate key.
|
DatastoreIdentifier |
newColumnIdentifier(String identifierName)
Method to use to generate an identifier for a column with the supplied name.
|
DatastoreIdentifier |
newColumnIdentifier(String javaName,
boolean embedded,
org.datanucleus.metadata.FieldRole fieldRole,
boolean custom)
Method to create an identifier for a column where we want the
name based on the supplied java name, and the field has a particular
role (and so could have its naming set according to the role).
|
DatastoreIdentifier |
newDiscriminatorFieldIdentifier()
Method to return an identifier for a discriminator column.
|
DatastoreIdentifier |
newForeignKeyFieldIdentifier(org.datanucleus.metadata.AbstractMemberMetaData ownerFmd,
org.datanucleus.metadata.AbstractMemberMetaData relatedFmd,
DatastoreIdentifier destinationId,
boolean embedded,
org.datanucleus.metadata.FieldRole fieldRole)
Method to generate a FK/FK-index field identifier.
|
DatastoreIdentifier |
newForeignKeyIdentifier(Table table,
int seq)
Method to create an identifier for a foreign key.
|
DatastoreIdentifier |
newIdentifier(DatastoreIdentifier identifier,
String suffix)
Method to return a new Identifier based on the passed identifier, but adding on the passed suffix
|
DatastoreIdentifier |
newIdentifier(IdentifierType identifierType,
String identifierName)
To be called when we want an identifier name creating based on the
identifier.
|
DatastoreIdentifier |
newIndexFieldIdentifier(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Method to return an identifier for an index (ordering) column.
|
DatastoreIdentifier |
newIndexIdentifier(Table table,
boolean isUnique,
int seq)
Method to generate an identifier for an index.
|
DatastoreIdentifier |
newJoinTableFieldIdentifier(org.datanucleus.metadata.AbstractMemberMetaData ownerFmd,
org.datanucleus.metadata.AbstractMemberMetaData relatedFmd,
DatastoreIdentifier destinationId,
boolean embedded,
org.datanucleus.metadata.FieldRole fieldRole)
Method to generate a join-table identifier.
|
DatastoreIdentifier |
newPrimaryKeyIdentifier(Table table)
Method to generate an identifier for a primary key.
|
DatastoreIdentifier |
newReferenceFieldIdentifier(org.datanucleus.metadata.AbstractMemberMetaData refMetaData,
org.datanucleus.metadata.AbstractClassMetaData implMetaData,
DatastoreIdentifier implIdentifier,
boolean embedded,
org.datanucleus.metadata.FieldRole fieldRole)
Method to generate an identifier name for reference field, based on the metadata for the
field, and the ClassMetaData for the implementation.
|
DatastoreIdentifier |
newSequenceIdentifier(String sequenceName)
Method to generate an identifier for a sequence using the passed name.
|
DatastoreIdentifier |
newTableIdentifier(org.datanucleus.metadata.AbstractClassMetaData md)
Method to return a Table identifier for the specified class.
|
DatastoreIdentifier |
newTableIdentifier(org.datanucleus.metadata.AbstractMemberMetaData fmd)
Method to return a Table identifier for the specified field.
|
DatastoreIdentifier |
newTableIdentifier(String identifierName)
Method to use to generate an identifier for a table with the supplied name in the default catalog/schema.
|
DatastoreIdentifier |
newTableIdentifier(String identifierName,
String catalogName,
String schemaName)
Method to use to generate an identifier for a table with the supplied name.
|
DatastoreIdentifier |
newVersionFieldIdentifier()
Method to return an identifier for a version column.
|
static final String PROPERTY_DEFAULT_CATALOG
static final String PROPERTY_DEFAULT_SCHEMA
static final String PROPERTY_REQUIRED_CASE
static final String PROPERTY_TABLE_PREFIX
static final String PROPERTY_TABLE_SUFFIX
static final String PROPERTY_WORD_SEPARATOR
static final String PROPERTY_NAMING_FACTORY
DatastoreAdapter getDatastoreAdapter()
org.datanucleus.store.schema.naming.NamingCase getNamingCase()
String getIdentifierInAdapterCase(String identifier)
identifier
- The identifier nameString getIdentifierTruncatedToAdapterColumnLength(String identifier)
identifier
- The identifierDatastoreIdentifier newIdentifier(IdentifierType identifierType, String identifierName)
identifierType
- the type of identifier to be createdidentifierName
- The identifier nameDatastoreIdentifier newTableIdentifier(String identifierName)
identifierName
- The identifier nameDatastoreIdentifier newTableIdentifier(String identifierName, String catalogName, String schemaName)
identifierName
- The identifier name for the tablecatalogName
- Optional catalog nameschemaName
- Optional schema nameDatastoreIdentifier newTableIdentifier(org.datanucleus.metadata.AbstractClassMetaData md)
md
- Meta data for the classDatastoreIdentifier newTableIdentifier(org.datanucleus.metadata.AbstractMemberMetaData fmd)
fmd
- Meta data for the fieldDatastoreIdentifier newColumnIdentifier(String identifierName)
identifierName
- The identifier nameDatastoreIdentifier newColumnIdentifier(String javaName, boolean embedded, org.datanucleus.metadata.FieldRole fieldRole, boolean custom)
javaName
- The java field nameembedded
- Whether the identifier is for a field embeddedfieldRole
- The role to be performed by this column e.g FK, Index ?custom
- Whether this has a user-defined nameDatastoreIdentifier newReferenceFieldIdentifier(org.datanucleus.metadata.AbstractMemberMetaData refMetaData, org.datanucleus.metadata.AbstractClassMetaData implMetaData, DatastoreIdentifier implIdentifier, boolean embedded, org.datanucleus.metadata.FieldRole fieldRole)
refMetaData
- the MetaData for the reference fieldimplMetaData
- the AbstractClassMetaData for this implementationimplIdentifier
- PK identifier for the implementationembedded
- Whether the identifier is for a field embeddedfieldRole
- The role to be performed by this column e.g FK, collection element ?DatastoreIdentifier newDiscriminatorFieldIdentifier()
DatastoreIdentifier newVersionFieldIdentifier()
DatastoreIdentifier newIdentifier(DatastoreIdentifier identifier, String suffix)
identifier
- The current identifiersuffix
- The suffixDatastoreIdentifier newJoinTableFieldIdentifier(org.datanucleus.metadata.AbstractMemberMetaData ownerFmd, org.datanucleus.metadata.AbstractMemberMetaData relatedFmd, DatastoreIdentifier destinationId, boolean embedded, org.datanucleus.metadata.FieldRole fieldRole)
ownerFmd
- MetaData for the owner fieldrelatedFmd
- MetaData for the related field (if bidirectional)destinationId
- Identifier for the identity field of the destination tableembedded
- Whether the identifier is for a field embeddedfieldRole
- The role to be performed by this column e.g FK, collection element ?DatastoreIdentifier newForeignKeyFieldIdentifier(org.datanucleus.metadata.AbstractMemberMetaData ownerFmd, org.datanucleus.metadata.AbstractMemberMetaData relatedFmd, DatastoreIdentifier destinationId, boolean embedded, org.datanucleus.metadata.FieldRole fieldRole)
ownerFmd
- MetaData for the owner fieldrelatedFmd
- MetaData for the related field (if bidirectional)destinationId
- Identifier for the identity field of the destination table (if strict FK)embedded
- Whether the identifier is for a field embeddedfieldRole
- The role to be performed by this column e.g owner, index ?DatastoreIdentifier newIndexFieldIdentifier(org.datanucleus.metadata.AbstractMemberMetaData mmd)
mmd
- Metadata for the field/property that we require to add an index(order) column forDatastoreIdentifier newAdapterIndexFieldIdentifier()
DatastoreIdentifier newSequenceIdentifier(String sequenceName)
sequenceName
- the name of the sequence to useDatastoreIdentifier newPrimaryKeyIdentifier(Table table)
table
- the tableDatastoreIdentifier newIndexIdentifier(Table table, boolean isUnique, int seq)
table
- the tableisUnique
- if the index is uniqueseq
- the sequential numberDatastoreIdentifier newCandidateKeyIdentifier(Table table, int seq)
table
- the tableseq
- Sequence numberDatastoreIdentifier newForeignKeyIdentifier(Table table, int seq)
table
- the tableseq
- the sequential numberCopyright © 2020. All rights reserved.