Package org.javalite.activejdbc.dialects
Class OracleDialect
java.lang.Object
org.javalite.activejdbc.dialects.DefaultDialect
org.javalite.activejdbc.dialects.OracleDialect
- All Implemented Interfaces:
Serializable
,Dialect
- Author:
- Igor Polevoy, Eric Nielsen
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.javalite.activejdbc.dialects.DefaultDialect
GROUP_BY_PATTERN, ORDER_BY_PATTERN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendEmptyRow(MetaModel metaModel, StringBuilder query)
protected void
appendTime(StringBuilder query, Time value)
formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset)
Example of a query we are building here:overrideDriverTypeConversion(MetaModel mm, String attributeName, Object value)
Methods inherited from class org.javalite.activejdbc.dialects.DefaultDialect
appendDate, appendOrderBy, appendQuestions, appendSelect, appendSubQuery, appendTimestamp, appendValue, deleteManyToManyAssociation, insert, insertManyToManyAssociation, insertParametrized, replace, selectCount, selectCount, selectExists, selectManyToManyAssociation, selectStar, selectStar, selectStarParametrized, toArray, update
-
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 interfaceDialect
- Overrides:
formSelect
in classDefaultDialect
- Parameters:
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.- Returns:
- 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
- Specified by:
overrideDriverTypeConversion
in interfaceDialect
- Overrides:
overrideDriverTypeConversion
in classDefaultDialect
-
appendEmptyRow
- Overrides:
appendEmptyRow
in classDefaultDialect
-
appendTime
- Overrides:
appendTime
in classDefaultDialect
-