Class DatastoreIdentifierImpl
java.lang.Object
org.datanucleus.store.rdbms.identifier.DatastoreIdentifierImpl
- All Implemented Interfaces:
DatastoreIdentifier
- Direct Known Subclasses:
CandidateKeyIdentifier
,ColumnIdentifier
,ForeignKeyIdentifier
,IndexIdentifier
,PrimaryKeyIdentifier
,SequenceIdentifier
,TableIdentifier
Implementation of a datastore identifier.
This can be something like a table name, column name, PK name, etc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
catalogprotected final DatastoreAdapter
Datastore adapterprotected final IdentifierFactory
Datastore Identifier factory.protected String
The name.protected String
schemaprivate String
String representation to reduce number of times the toString is constructed -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DatastoreIdentifierImpl
(IdentifierFactory factory, String sqlIdentifier) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Equality operator to judge if 2 identifiers are equal.Accessor for the catalogfinal String
getFullyQualifiedName
(boolean adapterCase) Accessor for a fully-qualified version of the identifier name.getName()
Accessor for the name.Accessor for the schemaint
hashCode()
Hash code method.void
setCatalogName
(String catalogName) Sets the catalogvoid
setSchemaName
(String schemaName) Sets the schemaprotected String
Mutator for the sql identifier.toString()
Method to output the name of the identifier.
-
Field Details
-
dba
Datastore adapter -
factory
Datastore Identifier factory. -
name
The name. -
catalogName
catalog -
schemaName
schema -
toString
String representation to reduce number of times the toString is constructed
-
-
Constructor Details
-
DatastoreIdentifierImpl
Constructor.- Parameters:
factory
- Identifier factorysqlIdentifier
- The SQL identifier name
-
-
Method Details
-
toCase
Mutator for the sql identifier. Takes account of the DB policy on upper, lower and mixed case identifiers. Optionally can truncate the identifier if it exceeds the "getMaxLength()".- Parameters:
identifierName
- The Identifier- Returns:
- The cased identifier
-
getName
Accessor for the name.- Specified by:
getName
in interfaceDatastoreIdentifier
- Returns:
- The name
-
setCatalogName
Sets the catalog- Specified by:
setCatalogName
in interfaceDatastoreIdentifier
- Parameters:
catalogName
- The catalog
-
setSchemaName
Sets the schema- Specified by:
setSchemaName
in interfaceDatastoreIdentifier
- Parameters:
schemaName
- The schema
-
getCatalogName
Accessor for the catalog- Specified by:
getCatalogName
in interfaceDatastoreIdentifier
- Returns:
- The catalog
-
getSchemaName
Accessor for the schema- Specified by:
getSchemaName
in interfaceDatastoreIdentifier
- Returns:
- The schema
-
hashCode
public int hashCode()Hash code method. -
equals
Equality operator to judge if 2 identifiers are equal.- Comparing NULL schema/owner names in one or both objects evaluates to true
- Comparing NULL catalog names in one or both objects evaluates to true
-
toString
Method to output the name of the identifier. This will be quoted where necessary. Will not include the catalog/schema names.- Specified by:
toString
in interfaceDatastoreIdentifier
- Overrides:
toString
in classObject
- Returns:
- The identifier name with any necessary quoting
-
getFullyQualifiedName
Accessor for a fully-qualified version of the identifier name. Allows for catalog/schema (if specified and if supported)- Specified by:
getFullyQualifiedName
in interfaceDatastoreIdentifier
- Parameters:
adapterCase
- Whether to use adapter case for the returned name- Returns:
- The fully-qualified name
-