Class SDriverPostgres

java.lang.Object
simpleorm.sessionjdbc.SDriver
simpleorm.drivers.SDriverPostgres

public class SDriverPostgres extends SDriver
This contains PostgreSQL specific code.

VARCHAR without size means unlimited. No artificial upper size? TEXT has the same behaviour as VARCHAR, apparently.

  • Constructor Details

    • SDriverPostgres

      public SDriverPostgres()
  • Method Details

    • driverName

      protected String driverName()
      Description copied from class: SDriver
      The driver name to be compared to getMetaData().getDriverName()
      Overrides:
      driverName in class SDriver
    • maxIdentNameLength

      public int maxIdentNameLength()
      Description copied from class: SDriver
      The maximum size for table names and foreign key constraint names.
      Overrides:
      maxIdentNameLength in class SDriver
    • columnTypeSQL

      protected String columnTypeSQL(SFieldScalar field, String defalt)
      Never need to specify byteSize for varchar
      Overrides:
      columnTypeSQL in class SDriver
    • generateKeySequence

      protected long generateKeySequence(SRecordMeta<?> rec, SFieldScalar keyFld)
      Specializes SDriver.generateKeySequence using the Postgres SEQUENCEs.
      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