Class TimesTenAdapter

  • All Implemented Interfaces:
    DatastoreAdapter

    public class TimesTenAdapter
    extends BaseDatastoreAdapter
    Provides methods for adapting SQL language elements to the Oracle Times Ten database
    • Field Detail

      • RESERVED_WORDS

        public static final java.lang.String RESERVED_WORDS
        A string containing the list of TimesTen reserved keywords
        See Also:
        Constant Field Values
    • Constructor Detail

      • TimesTenAdapter

        public TimesTenAdapter​(java.sql.DatabaseMetaData metadata)
        Constructor. Overridden so we can add on our own list of NON SQL92 reserved words which is returned incorrectly with the JDBC driver.
        Parameters:
        metadata - MetaData for the DB
    • Method Detail

      • getAddForeignKeyStatement

        public java.lang.String getAddForeignKeyStatement​(ForeignKey fk,
                                                          IdentifierFactory factory)
        Returns the appropriate SQL to add a foreign key to its table. It should return something like:
         ALTER TABLE FOO ADD CONSTRAINT FOO_FK1 FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2)
         ALTER TABLE FOO ADD FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2)
         
        Specified by:
        getAddForeignKeyStatement in interface DatastoreAdapter
        Overrides:
        getAddForeignKeyStatement in class BaseDatastoreAdapter
        Parameters:
        fk - An object describing the foreign key.
        factory - Identifier factory
        Returns:
        The text of the SQL statement.
      • isSelfReferencingForeignKey

        private static boolean isSelfReferencingForeignKey​(ForeignKey fk)
        Returns true if foreign key is self-referencing
        Parameters:
        fk - foreign key
        Returns:
        true if foreign key is self-referencing
      • isSelfReferencingForeignKey

        private static boolean isSelfReferencingForeignKey​(java.lang.String sql,
                                                           java.lang.String ref)
        Returns true if foreign key is self-referencing.
        Parameters:
        sql - foreign key creation statement
        ref - referenced table
        Returns:
        true if foreign key is self-referencing
      • loadColumnMappings

        protected void loadColumnMappings​(org.datanucleus.plugin.PluginManager mgr,
                                          org.datanucleus.ClassLoaderResolver clr)
        Load all datastore mappings for this RDBMS database.
        Overrides:
        loadColumnMappings in class BaseDatastoreAdapter
        Parameters:
        mgr - the PluginManager
        clr - the ClassLoaderResolver