Class OracleDialect

All Implemented Interfaces:
Serializable, Dialect

public class OracleDialect extends DefaultDialect
Igor Polevoy, Eric Nielsen
See Also:
Serialized Form
  • Constructor Details

    • OracleDialect

      public OracleDialect()
  • Method Details

    • formSelect

      public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset)
      Example of a query we are building here:
       SELECT * FROM (
         SELECT t2.*, ROWNUM AS oracle_row_number FROM (
           SELECT t.* FROM pages t WHERE <conditions> ORDER BY id
         ) t2
       ) WHERE oracle_row_number >= 20 AND rownum <= 10;

      Look here for reference: Oracle: ROW_NUMBER vs ROWNUM

      Specified by:
      formSelect in interface Dialect
      formSelect in class DefaultDialect
      tableName - name of table. If table name is null, then the subQuery parameter is considered to be a full query, and all that needs to be done is to add limit, offset and order bys
      columns - not used in this implementation.
      subQuery - sub query, something like: "name = ? AND ssn = ?". It can be blank: "" or null;
      orderBys - collection of order by: "dob desc" - one example
      limit - limit value, -1 if not needed.
      offset - offset value, -1 if not needed.
      Oracle - specific select query. Here is one example:
      SELECT * FROM (SELECT t2.*, ROWNUM AS oracle_row_number FROM (SELECT t.* FROM pages t WHERE <conditions> ORDER BY id) t2) WHERE oracle_row_number >= 20 AND rownum <= 10;
      Can't think of an uglier thing. Shame on you, Oracle.
    • overrideDriverTypeConversion

      public Object overrideDriverTypeConversion(MetaModel mm, String attributeName, Object value)
      Specified by:
      overrideDriverTypeConversion in interface Dialect
      overrideDriverTypeConversion in class DefaultDialect
    • appendEmptyRow

      protected void appendEmptyRow(MetaModel metaModel, StringBuilder query)
      appendEmptyRow in class DefaultDialect
    • appendTime

      protected void appendTime(StringBuilder query, Time value)
      appendTime in class DefaultDialect