Class SDriverHSQLH2

java.lang.Object
simpleorm.sessionjdbc.SDriver
simpleorm.drivers.SDriverHSQLH2
Direct Known Subclasses:
SDriverH2, SDriverHSQL

public abstract class SDriverHSQLH2 extends SDriver
Common code between HSQL and H2. Note that thewe toy databases do not support locking, so is not safe in multi user mode even with optimistic locking. See SDriver.supportsLocking().
  • Constructor Details

    • SDriverHSQLH2

      public SDriverHSQLH2()
  • Method Details

    • supportsLocking

      public boolean supportsLocking()
      HSQL has a major hole but optimistic locking papers over it. H2 might support locking?
      Overrides:
      supportsLocking in class SDriver
    • columnTypeSQL

      protected String columnTypeSQL(SFieldScalar field, String defalt)
      Description copied from class: SDriver
      Used to override the default. ONLY called if no fld.defaultSqlDataType has been specified, ie. only used to override the SFieldScalar.defaultSqlDataType.
      Overrides:
      columnTypeSQL in class SDriver
    • generateKeySequence

      protected long generateKeySequence(SRecordMeta<?> rec, SFieldScalar keyFld)
      Overrides:
      generateKeySequence in class SDriver
    • supportsKeySequences

      public boolean supportsKeySequences()
      Overrides:
      supportsKeySequences in class SDriver
    • createSequenceDDL

      protected String createSequenceDDL(String name)
      Overrides:
      createSequenceDDL in class SDriver
    • dropSequenceDDL

      protected String dropSequenceDDL(String name)
      Overrides:
      dropSequenceDDL in class SDriver
    • getOffsetStrategy

      protected SDriver.OffsetStrategy getOffsetStrategy()
      Description copied from class: SDriver
      JDBC prefered, if jdbc driver has a sensible scrollable resultset implemntation QUERY if database would handle it better via some proprietary sql extension (eg. LIMIT) BULK Simpleorm will get the whole resultset and skip de first row. Worst case scenario :(

      Defaults to BULK

      Overrides:
      getOffsetStrategy in class SDriver
    • limitSQL

      protected String limitSQL(long offset, long limit)
      Description copied from class: SDriver
      Drivers that choose to implement a QUERY offset strategy should return the limit statment here
      Overrides:
      limitSQL in class SDriver
      Parameters:
      offset - number of rows to skip
      limit - number of rows to retrieve
      Returns:
      LIMIT + OFFSET string statment