Class FirebirdAdapter

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

public class FirebirdAdapter extends BaseDatastoreAdapter
Provides methods for adapting SQL language elements to the Firebird database.
See Also:
  • Constructor Details

  • 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
    • getDropTableStatement

      public String getDropTableStatement(Table table)
      Description copied from class: BaseDatastoreAdapter
      Returns the appropriate SQL to drop the given table. It should return something like:
       DROP TABLE FOO CASCADE
       
      Specified by:
      getDropTableStatement in interface DatastoreAdapter
      Overrides:
      getDropTableStatement in class BaseDatastoreAdapter
      Parameters:
      table - The table to drop.
      Returns:
      The text of the SQL statement.
    • newSQLTypeInfo

      public SQLTypeInfo newSQLTypeInfo(ResultSet rs)
      Description copied from interface: DatastoreAdapter
      Create a new SQL type info from the current row of the passed ResultSet. Allows an adapter to override particular types where the JDBC driver is known to be buggy.
      Specified by:
      newSQLTypeInfo in interface DatastoreAdapter
      Overrides:
      newSQLTypeInfo in class BaseDatastoreAdapter
      Parameters:
      rs - ResultSet
      Returns:
      The SQL type info
    • getAddPrimaryKeyStatement

      public String getAddPrimaryKeyStatement(PrimaryKey pk, IdentifierFactory factory)
      Firebird accepts the PK in the CREATE TABLE statement.
      Specified by:
      getAddPrimaryKeyStatement in interface DatastoreAdapter
      Overrides:
      getAddPrimaryKeyStatement in class BaseDatastoreAdapter
      Parameters:
      pk - An object describing the primary key.
      factory - Identifier factory
      Returns:
      The PK statement
    • getSequenceCreateStmt

      public String getSequenceCreateStmt(String sequenceName, Integer min, Integer max, Integer start, Integer increment, Integer cacheSize)
      Accessor for the sequence create statement for this datastore.
      Specified by:
      getSequenceCreateStmt in interface DatastoreAdapter
      Overrides:
      getSequenceCreateStmt in class BaseDatastoreAdapter
      Parameters:
      sequenceName - Name of the sequence
      min - Minimum value for the sequence
      max - Maximum value for the sequence
      start - Start value for the sequence
      increment - Increment value for the sequence
      cacheSize - Cache size for the sequence
      Returns:
      The statement for getting the next id from the sequence
    • getSequenceNextStmt

      public String getSequenceNextStmt(String sequenceName)
      Accessor for the sequence statement to get the next id for this datastore.
      Specified by:
      getSequenceNextStmt in interface DatastoreAdapter
      Overrides:
      getSequenceNextStmt in class BaseDatastoreAdapter
      Parameters:
      sequenceName - Name of the sequence
      Returns:
      The statement for getting the next id for the sequence
    • getRangeByLimitEndOfStatementClause

      public String getRangeByLimitEndOfStatementClause(long offset, long count, boolean hasOrdering)
      Method to return the SQL to append to the WHERE clause of a SELECT statement to handle restriction of ranges using the ROWS keyword.
      Specified by:
      getRangeByLimitEndOfStatementClause in interface DatastoreAdapter
      Overrides:
      getRangeByLimitEndOfStatementClause in class BaseDatastoreAdapter
      Parameters:
      offset - The offset to return from
      count - The number of items to return
      hasOrdering - Whether ordering is present
      Returns:
      The SQL to append to allow for ranges using LIMIT.
    • supportsCharLengthFunction

      public boolean supportsCharLengthFunction()
    • getSQLMethodClass

      public Class<? extends SQLMethod> getSQLMethodClass(String className, String methodName, org.datanucleus.ClassLoaderResolver clr)
      Description copied from interface: DatastoreAdapter
      Accessor for the SQLMethod class for the query invocation of specified class + method name (if available for this datastore).
      Specified by:
      getSQLMethodClass in interface DatastoreAdapter
      Overrides:
      getSQLMethodClass in class BaseDatastoreAdapter
      Parameters:
      className - Name of the class (or null if this is a STATIC method)
      methodName - Method name
      clr - ClassLoader resolver, in case className is a subclass of a supported type
      Returns:
      The SQLMethod class (or null if not defined for this datastore).
    • 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