Class DatastoreIdentifierImpl

  • All Implemented Interfaces:
    DatastoreIdentifier

    public class DatastoreIdentifierImpl
    extends Object
    implements DatastoreIdentifier
    Implementation of a datastore identifier. This can be something like a table name, column name, PK name, etc.
    • Field Detail

      • name

        protected String name
        The name.
      • catalogName

        protected String catalogName
        catalog
      • schemaName

        protected String schemaName
        schema
    • Constructor Detail

      • DatastoreIdentifierImpl

        protected DatastoreIdentifierImpl​(IdentifierFactory factory,
                                          String sqlIdentifier)
        Constructor.
        Parameters:
        factory - Identifier factory
        sqlIdentifier - The SQL identifier name
    • Method Detail

      • toCase

        protected String toCase​(String identifierName)
        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
      • hashCode

        public int hashCode()
        Hash code method.
        Overrides:
        hashCode in class Object
        Returns:
        The hash code
      • equals

        public boolean equals​(Object obj)
        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
        TODO change the below behavior. will require changing all places creating an identifier to set the catalog name and schema name from jdo metadata and/or metadata collected from the db
        Overrides:
        equals in class Object
        Parameters:
        obj - Object to compare against
        Returns:
        Whether they are equal
      • toString

        public String 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 interface DatastoreIdentifier
        Overrides:
        toString in class Object
        Returns:
        The identifier name with any necessary quoting
      • getFullyQualifiedName

        public final String getFullyQualifiedName​(boolean adapterCase)
        Accessor for a fully-qualified version of the identifier name. Allows for catalog/schema (if specified and if supported)
        Specified by:
        getFullyQualifiedName in interface DatastoreIdentifier
        Parameters:
        adapterCase - Whether to use adapter case for the returned name
        Returns:
        The fully-qualified name