|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.mapped.AbstractIdentifierFactory
org.jpox.store.rdbms.sqlidentifier.AbstractRDBMSIdentifierFactory
org.jpox.store.rdbms.sqlidentifier.JPAIdentifierFactory
public class JPAIdentifierFactory
Factory that creates immutable instances of DatastoreIdentifier for RDBMS datastores with JPA. Includes the JPA naming strategy, naming as follows
| Field Summary |
|---|
| Fields inherited from class org.jpox.store.rdbms.sqlidentifier.AbstractRDBMSIdentifierFactory |
|---|
candidates, columns, defaultCatalogName, defaultSchemaName, foreignkeys, indexes, primarykeys, rdba, references, sequences, tables, wordSeparator |
| Fields inherited from class org.jpox.store.mapped.AbstractIdentifierFactory |
|---|
CASE_LOWER, CASE_PRESERVE, CASE_UPPER, dba, identifierCase, LOCALISER |
| Fields inherited from interface org.jpox.store.mapped.IdentifierFactory |
|---|
CANDIDATE_KEY, COLUMN, FOREIGN_KEY, IDENTIFIER_LOWER_CASE, IDENTIFIER_LOWER_CASE_QUOTED, IDENTIFIER_MIXED_CASE, IDENTIFIER_MIXED_CASE_QUOTED, IDENTIFIER_UPPER_CASE, IDENTIFIER_UPPER_CASE_QUOTED, INDEX, PRIMARY_KEY, SEQUENCE, TABLE |
| Constructor Summary | |
|---|---|
JPAIdentifierFactory(org.jpox.store.mapped.DatastoreAdapter dba,
java.lang.String defaultCatalog,
java.lang.String defaultSchema,
java.lang.String requiredCase,
java.lang.String wordSeparator,
java.lang.String tablePrefix,
java.lang.String tableSuffix)
Constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
generateIdentifierNameForJavaName(java.lang.String javaName)
Generate a datastore identifier from a Java identifier. |
protected java.lang.String |
getColumnIdentifierSuffix(int role,
boolean embedded)
Accessor for the suffix to add to any column identifier, based on the role type. |
org.jpox.store.mapped.DatastoreIdentifier |
newAdapterIndexFieldIdentifier()
Method to return an identifier for an adapter index datastore field. |
org.jpox.store.mapped.DatastoreIdentifier |
newDatastoreContainerIdentifier(org.jpox.ClassLoaderResolver clr,
org.jpox.metadata.AbstractClassMetaData cmd)
Method to return a Table identifier for the specified class. |
org.jpox.store.mapped.DatastoreIdentifier |
newDatastoreContainerIdentifier(org.jpox.ClassLoaderResolver clr,
org.jpox.metadata.AbstractMemberMetaData fmd)
Method to return a Table identifier for the join table of the specified field. |
org.jpox.store.mapped.DatastoreIdentifier |
newDiscriminatorFieldIdentifier()
Method to return an identifier for a discriminator column. |
org.jpox.store.mapped.DatastoreIdentifier |
newForeignKeyFieldIdentifier(org.jpox.metadata.AbstractMemberMetaData ownerFmd,
org.jpox.metadata.AbstractMemberMetaData relatedFmd,
org.jpox.store.mapped.DatastoreIdentifier destinationId,
boolean embedded,
int fieldRole)
Method to generate a FK/FK-index field identifier. |
org.jpox.store.mapped.DatastoreIdentifier |
newIndexFieldIdentifier()
Method to return an identifier for an index datastore field. |
org.jpox.store.mapped.DatastoreIdentifier |
newJoinTableFieldIdentifier(org.jpox.metadata.AbstractMemberMetaData ownerFmd,
org.jpox.metadata.AbstractMemberMetaData relatedFmd,
org.jpox.store.mapped.DatastoreIdentifier destinationId,
boolean embedded,
int fieldRole)
Method to generate a join-table identifier. |
org.jpox.store.mapped.DatastoreIdentifier |
newReferenceFieldIdentifier(org.jpox.metadata.AbstractMemberMetaData refMetaData,
org.jpox.metadata.AbstractClassMetaData implMetaData,
org.jpox.store.mapped.DatastoreIdentifier implIdentifier,
boolean embedded,
int fieldRole)
Method to generate an identifier name for reference field, based on the metadata for the field, and the ClassMetaData for the implementation. |
org.jpox.store.mapped.DatastoreIdentifier |
newVersionFieldIdentifier()
Method to return an identifier for a version datastore field. |
| Methods inherited from class org.jpox.store.mapped.AbstractIdentifierFactory |
|---|
getDatastoreAdapter, getIdentifierCase, getNameOfIdentifierCase, truncate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jpox.store.mapped.IdentifierFactory |
|---|
getDatastoreAdapter, getIdentifierCase, getNameOfIdentifierCase |
| Constructor Detail |
|---|
public JPAIdentifierFactory(org.jpox.store.mapped.DatastoreAdapter dba,
java.lang.String defaultCatalog,
java.lang.String defaultSchema,
java.lang.String requiredCase,
java.lang.String wordSeparator,
java.lang.String tablePrefix,
java.lang.String tableSuffix)
dba - Datastore adapterdefaultCatalog - Name of the default catalog (if any)defaultSchema - Name of the default schema (if any)requiredCase - The case the user requireswordSeparator - Word separator for identifierstablePrefix - Prefix for table names when being generatedtableSuffix - Suffix for table names when being generated| Method Detail |
|---|
public org.jpox.store.mapped.DatastoreIdentifier newDatastoreContainerIdentifier(org.jpox.ClassLoaderResolver clr,
org.jpox.metadata.AbstractMemberMetaData fmd)
clr - the ClassLoaderResolverfmd - Meta data for the field
public org.jpox.store.mapped.DatastoreIdentifier newDatastoreContainerIdentifier(org.jpox.ClassLoaderResolver clr,
org.jpox.metadata.AbstractClassMetaData cmd)
clr - the ClassLoaderResolvercmd - Meta data for the class
public org.jpox.store.mapped.DatastoreIdentifier newReferenceFieldIdentifier(org.jpox.metadata.AbstractMemberMetaData refMetaData,
org.jpox.metadata.AbstractClassMetaData implMetaData,
org.jpox.store.mapped.DatastoreIdentifier implIdentifier,
boolean embedded,
int 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 ?
public org.jpox.store.mapped.DatastoreIdentifier newJoinTableFieldIdentifier(org.jpox.metadata.AbstractMemberMetaData ownerFmd,
org.jpox.metadata.AbstractMemberMetaData relatedFmd,
org.jpox.store.mapped.DatastoreIdentifier destinationId,
boolean embedded,
int fieldRole)
ownerFmd - MetaData for the owner fieldrelatedFmd - MetaData for the related fielddestinationId - Identifier for the identity field of the destination (if FK)embedded - Whether the identifier is for a field embeddedfieldRole - The role to be performed by this column e.g FK, collection element ?
public org.jpox.store.mapped.DatastoreIdentifier newForeignKeyFieldIdentifier(org.jpox.metadata.AbstractMemberMetaData ownerFmd,
org.jpox.metadata.AbstractMemberMetaData relatedFmd,
org.jpox.store.mapped.DatastoreIdentifier destinationId,
boolean embedded,
int fieldRole)
ownerFmd - MetaData for the owner fieldrelatedFmd - MetaData for the related fielddestinationId - 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 ROLE_OWNER, ROLE_INDEX
public org.jpox.store.mapped.DatastoreIdentifier newDiscriminatorFieldIdentifier()
public org.jpox.store.mapped.DatastoreIdentifier newVersionFieldIdentifier()
public org.jpox.store.mapped.DatastoreIdentifier newIndexFieldIdentifier()
public org.jpox.store.mapped.DatastoreIdentifier newAdapterIndexFieldIdentifier()
public java.lang.String generateIdentifierNameForJavaName(java.lang.String javaName)
Conversion consists of breaking the identifier into words, converting each word to upper-case, and separating each one with an underscore "_". Words are identified by a leading upper-case character. Any leading or trailing underscores are removed.
generateIdentifierNameForJavaName in class AbstractRDBMSIdentifierFactoryjavaName - the Java identifier.
protected java.lang.String getColumnIdentifierSuffix(int role,
boolean embedded)
getColumnIdentifierSuffix in class AbstractRDBMSIdentifierFactoryrole - Datastore field roleembedded - Whether the DatastoreField is stored embedded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||