org.jpox.store
Interface IdentifierFactory

All Known Implementing Classes:
AbstractIdentifierFactory

public interface IdentifierFactory

Factory that creates immutable instances of DatastoreIdentifier. Identifiers are of a particular type. Each datastore could invent its own particular types as required, just that the ones here should be the principal types required.

Version:
$Revision: 1.16 $

Field Summary
static int CANDIDATE_KEY
          candidate key - unique index constraint
static int COLUMN
          column
static int FOREIGN_KEY
          foreign key
static int IDENTIFIER_LOWER_CASE
          Representation of an identifier specified in lower case.
static int IDENTIFIER_LOWER_CASE_QUOTED
          Representation of an identifier specified in "lower case"
static int IDENTIFIER_MIXED_CASE
          Representation of an identifier specified in Mixed Case.
static int IDENTIFIER_MIXED_CASE_QUOTED
          Representation of an identifier specified in "Mixed Case".
static int IDENTIFIER_UPPER_CASE
          Representation of an identifier specified in UPPER CASE
static int IDENTIFIER_UPPER_CASE_QUOTED
          Representation of an identifier specified in "UPPER CASE"
static int INDEX
          index
static int PRIMARY_KEY
          primary key
static int SEQUENCE
          identifier for datastore sequence.
static int TABLE
          identifier for table names
 
Method Summary
 DatastoreAdapter getDatastoreAdapter()
          Accessor for the datastore adapter that we are creating identifiers for.
 int getIdentifierCase()
          Accessor for the identifier case being used.
 java.lang.String getIdentifierInAdapterCase(java.lang.String identifier)
          Accessor for an identifier for use in the datastore adapter
 java.lang.String getNameOfIdentifierCase()
          Convenience method to return the name for the identifier case.
 DatastoreIdentifier newDatastoreContainerIdentifier(ClassLoaderResolver clr, AbstractClassMetaData md)
          Method to return a Table identifier for the specified class.
 DatastoreIdentifier newDatastoreContainerIdentifier(ClassLoaderResolver clr, AbstractMemberMetaData fmd)
          Method to return a Table identifier for the specified field.
 DatastoreIdentifier newDatastoreContainerIdentifier(java.lang.String identifierName)
          Method to use to generate an identifier for a datastore field with the supplied name.
 DatastoreIdentifier newDatastoreFieldIdentifier(java.lang.String identifierName)
          Method to use to generate an identifier for a datastore field with the supplied name.
 DatastoreIdentifier newDatastoreFieldIdentifier(java.lang.String javaName, boolean embedded, int fieldRole)
          Method to create an identifier for a datastore field 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 datastore field.
 DatastoreIdentifier newIdentifier(DatastoreIdentifier identifier, java.lang.String suffix)
          Method to return a new Identifier based on the passed identifier, but adding on the passed suffix
 DatastoreIdentifier newIdentifier(int identifierType, java.lang.String sqlIdentifier)
          To be called when we want an identifier name creating based on the identifier.
 DatastoreIdentifier newReferenceFieldIdentifier(AbstractMemberMetaData refMetaData, AbstractClassMetaData implMetaData, 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.
 DatastoreIdentifier newVersionFieldIdentifier()
          Method to return an identifier for a version datastore field.
 

Field Detail

IDENTIFIER_UPPER_CASE

static final int IDENTIFIER_UPPER_CASE
Representation of an identifier specified in UPPER CASE

See Also:
Constant Field Values

IDENTIFIER_UPPER_CASE_QUOTED

static final int IDENTIFIER_UPPER_CASE_QUOTED
Representation of an identifier specified in "UPPER CASE"

See Also:
Constant Field Values

IDENTIFIER_LOWER_CASE

static final int IDENTIFIER_LOWER_CASE
Representation of an identifier specified in lower case.

See Also:
Constant Field Values

IDENTIFIER_LOWER_CASE_QUOTED

static final int IDENTIFIER_LOWER_CASE_QUOTED
Representation of an identifier specified in "lower case"

See Also:
Constant Field Values

IDENTIFIER_MIXED_CASE

static final int IDENTIFIER_MIXED_CASE
Representation of an identifier specified in Mixed Case.

See Also:
Constant Field Values

IDENTIFIER_MIXED_CASE_QUOTED

static final int IDENTIFIER_MIXED_CASE_QUOTED
Representation of an identifier specified in "Mixed Case".

See Also:
Constant Field Values

TABLE

static final int TABLE
identifier for table names

See Also:
Constant Field Values

COLUMN

static final int COLUMN
column

See Also:
Constant Field Values

FOREIGN_KEY

static final int FOREIGN_KEY
foreign key

See Also:
Constant Field Values

INDEX

static final int INDEX
index

See Also:
Constant Field Values

CANDIDATE_KEY

static final int CANDIDATE_KEY
candidate key - unique index constraint

See Also:
Constant Field Values

PRIMARY_KEY

static final int PRIMARY_KEY
primary key

See Also:
Constant Field Values

SEQUENCE

static final int SEQUENCE
identifier for datastore sequence.

See Also:
Constant Field Values
Method Detail

getDatastoreAdapter

DatastoreAdapter getDatastoreAdapter()
Accessor for the datastore adapter that we are creating identifiers for.

Returns:
The datastore adapter

getIdentifierCase

int getIdentifierCase()
Accessor for the identifier case being used.

Returns:
The identifier case

getNameOfIdentifierCase

java.lang.String getNameOfIdentifierCase()
Convenience method to return the name for the identifier case.

Returns:
Identifier case name

getIdentifierInAdapterCase

java.lang.String getIdentifierInAdapterCase(java.lang.String identifier)
Accessor for an identifier for use in the datastore adapter

Parameters:
identifier - The identifier name
Returns:
Identifier name for use with the datastore adapter

newIdentifier

DatastoreIdentifier newIdentifier(int identifierType,
                                  java.lang.String sqlIdentifier)
To be called when we want an identifier name creating based on the identifier. Creates identifier for COLUMN, FOREIGN KEY, INDEX and TABLE

Parameters:
identifierType - the type of identifier to be created
sqlIdentifier - The SQL identifier name
Returns:
The DatastoreIdentifier

newDatastoreContainerIdentifier

DatastoreIdentifier newDatastoreContainerIdentifier(java.lang.String identifierName)
Method to use to generate an identifier for a datastore field with the supplied name. The passed name will not be changed (other than in its case) although it may be truncated to fit the maximum length permitted for a datastore field identifier.

Parameters:
identifierName - The identifier name
Returns:
The DatastoreIdentifier for the table

newDatastoreContainerIdentifier

DatastoreIdentifier newDatastoreContainerIdentifier(ClassLoaderResolver clr,
                                                    AbstractClassMetaData md)
Method to return a Table identifier for the specified class.

Parameters:
clr - the ClassLoaderResolver
md - Meta data for the class
Returns:
The identifier for the table

newDatastoreContainerIdentifier

DatastoreIdentifier newDatastoreContainerIdentifier(ClassLoaderResolver clr,
                                                    AbstractMemberMetaData fmd)
Method to return a Table identifier for the specified field.

Parameters:
clr - the ClassLoaderResolver
fmd - Meta data for the field
Returns:
The identifier for the table

newDatastoreFieldIdentifier

DatastoreIdentifier newDatastoreFieldIdentifier(java.lang.String identifierName)
Method to use to generate an identifier for a datastore field with the supplied name. The passed name will not be changed (other than in its case) although it may be truncated to fit the maximum length permitted for a datastore field identifier.

Parameters:
identifierName - The identifier name
Returns:
The DatastoreIdentifier

newDatastoreFieldIdentifier

DatastoreIdentifier newDatastoreFieldIdentifier(java.lang.String javaName,
                                                boolean embedded,
                                                int fieldRole)
Method to create an identifier for a datastore field 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).

Parameters:
javaName - The java field name
embedded - Whether the identifier is for a field embedded
fieldRole - The role to be performed by this column e.g FK, Index ?
Returns:
The DatastoreIdentifier

newReferenceFieldIdentifier

DatastoreIdentifier newReferenceFieldIdentifier(AbstractMemberMetaData refMetaData,
                                                AbstractClassMetaData implMetaData,
                                                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.

Parameters:
refMetaData - the MetaData for the reference field
implMetaData - the AbstractClassMetaData for this implementation
implIdentifier - PK identifier for the implementation
embedded - Whether the identifier is for a field embedded
fieldRole - The role to be performed by this column e.g FK, collection element ?
Returns:
The DatastoreIdentifier

newDiscriminatorFieldIdentifier

DatastoreIdentifier newDiscriminatorFieldIdentifier()
Method to return an identifier for a discriminator datastore field.

Returns:
The discriminator datastore field identifier

newVersionFieldIdentifier

DatastoreIdentifier newVersionFieldIdentifier()
Method to return an identifier for a version datastore field.

Returns:
The version datastore field identifier

newIdentifier

DatastoreIdentifier newIdentifier(DatastoreIdentifier identifier,
                                  java.lang.String suffix)
Method to return a new Identifier based on the passed identifier, but adding on the passed suffix

Parameters:
identifier - The current identifier
suffix - The suffix
Returns:
The new identifier


Copyright © -2008 . All Rights Reserved.