Class 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 Detail

      • SDriverHSQLH2

        public SDriverHSQLH2()
    • Method Detail

      • 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 java.lang.String columnTypeSQL​(SFieldScalar field,
                                                 java.lang.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
      • createSequenceDDL

        protected java.lang.String createSequenceDDL​(java.lang.String name)
        Overrides:
        createSequenceDDL in class SDriver
      • dropSequenceDDL

        protected java.lang.String dropSequenceDDL​(java.lang.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 java.lang.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