Class SolidDBDictionary

java.lang.Object
org.apache.openjpa.jdbc.sql.DBDictionary
org.apache.openjpa.jdbc.sql.SolidDBDictionary
All Implemented Interfaces:
JoinSyntaxes, Configurable, IdentifierConfiguration, ConnectionDecorator, LoggingConnectionDecorator.SQLWarningHandler

public class SolidDBDictionary extends DBDictionary
Dictionary for SolidDB database.
  • Field Details

    • storeIsMemory

      public boolean storeIsMemory
      Sets whether tables are to be located in-memory or on disk. Creating in-memory tables should append "STORE MEMORY" to the "CREATE TABLE" statement. Creating disk-based tables should append "STORE DISK". Since cursor hold over commit can not apply to M-tables (which will cause SOLID Table Error 13187: The cursor cannot continue accessing M-tables after the transaction has committed or aborted. The statement must be re-executed.), the default is STORE DISK. The default concurrency control mechanism depends on the table type: Disk-based tables (D-tables) are by default optimistic. Main-memory tables (M-tables) are always pessimistic. Since OpenJPA applications expects lock waits (as usually is done with normal pessimistic databases), the server should be set to the pessimistic mode. The optimistic mode is about not waiting for the locks at all. That increases concurrency but requires more programming. The pessimistic mode with the READ COMMITTED isolation level (default) should get as much concurrency as one might need. The pessimistic locking mode can be set in solid.ini: [General] Pessimistic=yes
    • useTriggersForAutoAssign

      public boolean useTriggersForAutoAssign
      If true, then simulate auto-assigned values in SolidDB by using a trigger that inserts a sequence value into the primary key value when a row is inserted.
    • autoAssignSequenceName

      public String autoAssignSequenceName
      The global sequence name to use for auto-assign simulation.
    • openjpa3GeneratedKeyNames

      public boolean openjpa3GeneratedKeyNames
      Flag to use OpenJPA 0.3 style naming for auto assign sequence name and trigger name for backwards compatibility.
    • lockingMode

      public String lockingMode
      Possible values for LockingMode are "PESSIMISTIC" and "OPTIMISTIC"
  • Constructor Details

    • SolidDBDictionary

      public SolidDBDictionary()
  • Method Details

    • endConfiguration

      public void endConfiguration()
      Description copied from interface: Configurable
      Invoked upon completion of bean property configuration for this object.
      Specified by:
      endConfiguration in interface Configurable
      Overrides:
      endConfiguration in class DBDictionary
    • getCreateTableSQL

      public String[] getCreateTableSQL(Table table, SchemaGroup group)
      Description copied from class: DBDictionary
      Return a series of SQL statements to create the given table, complete with columns. Indexes and constraints will be created separately.
      Overrides:
      getCreateTableSQL in class DBDictionary
    • sequenceExists

      protected boolean sequenceExists(String schemaName, String seqName, SchemaGroup group)
    • getGeneratedKeyTriggerName

      protected String getGeneratedKeyTriggerName(Column col)
      Trigger name for simulating auto-assign values on the given column.
    • getOpenJPA3GeneratedKeySequenceName

      protected String getOpenJPA3GeneratedKeySequenceName(Column col)
      Returns a OpenJPA 3-compatible name for an auto-assign sequence.
    • getOpenJPA3GeneratedKeyTriggerName

      protected String getOpenJPA3GeneratedKeyTriggerName(Column col)
      Returns a OpenJPA 3-compatible name for an auto-assign trigger.
    • getAutoGenSeqName

      protected String getAutoGenSeqName(Column col)
    • getGenKeySeqName

      protected String getGenKeySeqName(String query, Column col)
      Overrides:
      getGenKeySeqName in class DBDictionary
    • convertSchemaCase

      public String convertSchemaCase(DBIdentifier objectName)
      Description copied from class: DBDictionary
      Convert the specified schema name to a name that the database will be able to understand.
      Overrides:
      convertSchemaCase in class DBDictionary
    • substring

      public void substring(SQLBuffer buf, FilterValue str, FilterValue start, FilterValue length)
      Description copied from class: DBDictionary
      Invoke this database's substring function. Numeric parameters are inlined if possible. This is to handle grouping by SUBSTRING - most databases do not allow parameter binding in this case.
      Overrides:
      substring in class DBDictionary
      Parameters:
      buf - the SQL buffer to write the substring invocation to
      str - a query value representing the target string
      start - a query value representing the start index
      length - a query value representing the length of substring, or null for none
    • indexOf

      public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
      Description copied from class: DBDictionary
      Invoke this database's indexOf function.
      Overrides:
      indexOf in class DBDictionary
      Parameters:
      buf - the SQL buffer to write the indexOf invocation to
      str - a query value representing the target string
      find - a query value representing the search string
      start - a query value representing the start index, or null to start at the beginning
    • isSystemIndex

      public boolean isSystemIndex(DBIdentifier name, Table table)
      Description copied from class: DBDictionary
      This method is used to filter system indexes from database metadata. Return true if the given index name represents a system index that should not appear in the schema definition. Returns false by default.
      Overrides:
      isSystemIndex in class DBDictionary
      Parameters:
      name - the index name
      table - the index table
    • isSystemSequence

      public boolean isSystemSequence(DBIdentifier name, DBIdentifier schema, boolean targetSchema)
      Description copied from class: DBDictionary
      This method is used to filter system sequences from database metadata. Return true if the given sequence represents a system sequence that should not appear in the schema definition. Returns true if system schema by default.
      Overrides:
      isSystemSequence in class DBDictionary
      Parameters:
      name - the table name
      schema - the table schema; may be null
      targetSchema - if true, then the given schema was listed by the user as one of his schemas
    • setBigDecimal

      public void setBigDecimal(PreparedStatement stmnt, int idx, BigDecimal val, Column col) throws SQLException
      Description copied from class: DBDictionary
      Set the given value as a parameter to the statement.
      Overrides:
      setBigDecimal in class DBDictionary
      Throws:
      SQLException
    • setDouble

      public void setDouble(PreparedStatement stmnt, int idx, double val, Column col) throws SQLException
      Description copied from class: DBDictionary
      Set the given value as a parameter to the statement.
      Overrides:
      setDouble in class DBDictionary
      Throws:
      SQLException
    • needsToCreateIndex

      public boolean needsToCreateIndex(Index idx, Table table, Unique[] uniques)
      Overrides:
      needsToCreateIndex in class DBDictionary
    • getSequencesSQL

      protected String getSequencesSQL(String schemaName, String sequenceName)
      Description copied from class: DBDictionary
      Return the SQL needed to select the list of sequences.
      Overrides:
      getSequencesSQL in class DBDictionary
    • getSequencesSQL

      protected String getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)
      Overrides:
      getSequencesSQL in class DBDictionary
    • appendSelect

      protected void appendSelect(SQLBuffer selectSQL, Object alias, Select sel, int idx)
      Description copied from class: DBDictionary
      Append elem to selectSQL.
      Overrides:
      appendSelect in class DBDictionary
      Parameters:
      selectSQL - The SQLBuffer to append to.
      alias - A SQLBuffer or a String to append.
    • newForeignKey

      protected ForeignKey newForeignKey(ResultSet fkMeta) throws SQLException
      Solid does not support deferred referential integrity checking.
      Overrides:
      newForeignKey in class DBDictionary
      Throws:
      SQLException
    • isFatalException

      public boolean isFatalException(int subtype, SQLException ex)
      Description copied from class: DBDictionary
      Determine if the given SQL Exception is fatal or recoverable (such as a timeout). This implementation always returns true (i.e. all exceptions are fatal). The current dictionary implementation can overwrite this method to mark certain exception conditions as recoverable error.
      Overrides:
      isFatalException in class DBDictionary
      Parameters:
      subtype - A constant indicating the category of error as defined in StoreException.
      ex - original SQL Exception as raised by the database driver.
      Returns:
      false if the error is fatal.