public class OracleDialect extends DefaultDialect
GROUP_BY_PATTERN, ORDER_BY_PATTERN
Constructor and Description |
---|
OracleDialect() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendEmptyRow(MetaModel metaModel,
StringBuilder query) |
protected void |
appendTime(StringBuilder query,
Time value) |
String |
formSelect(String tableName,
String[] columns,
String subQuery,
List<String> orderBys,
long limit,
long offset)
Example of a query we are building here:
|
Object |
overrideDriverTypeConversion(MetaModel mm,
String attributeName,
Object value) |
appendDate, appendOrderBy, appendQuestions, appendSelect, appendSubQuery, appendTimestamp, appendValue, deleteManyToManyAssociation, insert, insertManyToManyAssociation, insertParametrized, replace, selectCount, selectCount, selectExists, selectManyToManyAssociation, selectStar, selectStar, selectStarParametrized, update
public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset)
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
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 byscolumns
- 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 examplelimit
- limit value, -1 if not needed.offset
- offset value, -1 if not needed.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.
public Object overrideDriverTypeConversion(MetaModel mm, String attributeName, Object value)
overrideDriverTypeConversion
in interface Dialect
overrideDriverTypeConversion
in class DefaultDialect
protected void appendEmptyRow(MetaModel metaModel, StringBuilder query)
appendEmptyRow
in class DefaultDialect
protected void appendTime(StringBuilder query, Time value)
appendTime
in class DefaultDialect
Copyright © 2019 JavaLite. All rights reserved.