Class TimesTenAdapter

java.lang.Object
org.datanucleus.store.rdbms.adapter.BaseDatastoreAdapter
org.datanucleus.store.rdbms.adapter.TimesTenAdapter
All Implemented Interfaces:
DatastoreAdapter

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

    • RESERVED_WORDS

      public static final String RESERVED_WORDS
      A string containing the list of TimesTen reserved keywords
      See Also:
  • Constructor Details

    • TimesTenAdapter

      public TimesTenAdapter(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 Details

    • getVendorID

      public String getVendorID()
      Description copied from interface: DatastoreAdapter
      Accessor for the Vendor ID for this datastore.
      Specified by:
      getVendorID in interface DatastoreAdapter
      Overrides:
      getVendorID in class BaseDatastoreAdapter
      Returns:
      Vendor id for this datastore
    • getAddCandidateKeyStatement

      public String getAddCandidateKeyStatement(CandidateKey ck, IdentifierFactory factory)
      Returns the appropriate SQL to add a candidate key to its table. It should return something like:
       ALTER TABLE FOO ADD CONSTRAINT FOO_CK (BAZ)
       ALTER TABLE FOO ADD (BAZ)
       
      Specified by:
      getAddCandidateKeyStatement in interface DatastoreAdapter
      Overrides:
      getAddCandidateKeyStatement in class BaseDatastoreAdapter
      Parameters:
      ck - An object describing the candidate key.
      factory - Identifier factory
      Returns:
      The text of the SQL statement.
    • getAddColumnStatement

      public String getAddColumnStatement(Table table, Column col)
      Accessor for the SQL statement to add a column to a table.
      Specified by:
      getAddColumnStatement in interface DatastoreAdapter
      Overrides:
      getAddColumnStatement in class BaseDatastoreAdapter
      Parameters:
      table - The table
      col - The column
      Returns:
      The SQL necessary to add the column
    • getAddForeignKeyStatement

      public 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(String sql, 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
    • getDatastoreDateStatement

      public String getDatastoreDateStatement()
      Accessor for a statement that will return the statement to use to get the datastore date.
      Specified by:
      getDatastoreDateStatement in interface DatastoreAdapter
      Overrides:
      getDatastoreDateStatement in class BaseDatastoreAdapter
      Returns:
      SQL statement to get the datastore date
    • 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