|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmondrian.spi.impl.JdbcDialectImpl
mondrian.spi.impl.DerbyDialect
public class DerbyDialect
Implementation of Dialect
for the Apache Derby database.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface mondrian.spi.Dialect |
---|
Dialect.DatabaseProduct, Dialect.Datatype, Dialect.NullCollation |
Field Summary | |
---|---|
static JdbcDialectFactory |
FACTORY
|
Fields inherited from class mondrian.spi.impl.JdbcDialectImpl |
---|
databaseProduct, permitsSelectNotInGroupBy, productVersion |
Constructor Summary | |
---|---|
DerbyDialect(Connection connection)
Creates a DerbyDialect. |
Method Summary | |
---|---|
boolean |
allowsMultipleCountDistinct()
Returns whether this Dialect supports more than one distinct aggregation in the same query. |
String |
generateInline(List<String> columnNames,
List<String> columnTypes,
List<String[]> valueList)
Generates a SQL statement to represent an inline dataset. |
String |
generateOrderItem(String expr,
boolean nullable,
boolean ascending)
Generates an item for an ORDER BY clause, sorting in the required direction, and ensuring that NULL values collate after all non-NULL values. |
protected void |
quoteDateLiteral(StringBuilder buf,
String value,
Date date)
Helper method for JdbcDialectImpl.quoteDateLiteral(StringBuilder, String) . |
boolean |
requiresAliasForFromQuery()
Returns whether this Dialect requires subqueries in the FROM clause to have an alias. |
boolean |
supportsGroupByExpressions()
Returns whether this Dialect supports expressions in the GROUP BY clause. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final JdbcDialectFactory FACTORY
Constructor Detail |
---|
public DerbyDialect(Connection connection) throws SQLException
connection
- Connection
SQLException
Method Detail |
---|
protected void quoteDateLiteral(StringBuilder buf, String value, Date date)
JdbcDialectImpl
JdbcDialectImpl.quoteDateLiteral(StringBuilder, String)
.
quoteDateLiteral
in class JdbcDialectImpl
buf
- Buffer to append tovalue
- Value as stringdate
- Value as datepublic boolean requiresAliasForFromQuery()
Dialect
requiresAliasForFromQuery
in interface Dialect
requiresAliasForFromQuery
in class JdbcDialectImpl
Dialect.allowsFromQuery()
public boolean allowsMultipleCountDistinct()
Dialect
In Derby 10.1,
select couunt(distinct x) from t
is OK, but
select couunt(distinct x), count(distinct y) from t
gives "Multiple DISTINCT aggregates are not supported at this time."
allowsMultipleCountDistinct
in interface Dialect
allowsMultipleCountDistinct
in class JdbcDialectImpl
public String generateInline(List<String> columnNames, List<String> columnTypes, List<String[]> valueList)
Dialect
For example, for Oracle, generates
SELECT 1 AS FOO, 'a' AS BAR FROM dual UNION ALL SELECT 2 AS FOO, 'b' AS BAR FROM dual
For ANSI SQL, generates:
VALUES (1, 'a'), (2, 'b')
generateInline
in interface Dialect
generateInline
in class JdbcDialectImpl
columnNames
- List of column namescolumnTypes
- List of column types ("String" or "Numeric")valueList
- List of rows values
public boolean supportsGroupByExpressions()
Dialect
supportsGroupByExpressions
in interface Dialect
supportsGroupByExpressions
in class JdbcDialectImpl
public String generateOrderItem(String expr, boolean nullable, boolean ascending)
Dialect
By default, generateOrderItem(expr, true)
generates "expr ASC"
and generateOrderItem(expr, false)
generates "expr DESC". But
depending on Dialect.getNullCollation()
and ascending
, there
may need to be additional code.
For example, on Oracle, where NULLs collate higher than all other
values, generateOrderItem(expr, true)
generates "expr ASC" and
generateOrderItem(expr, false)
generates "expr DESC NULLS LAST".
On MySQL, where NULLs collate lower than all other values,
generateOrderItem(expr, true)
generates "ISNULL(expr), expr ASC"
and generateOrderItem(expr, false)
generates "expr DESC".
generateOrderItem
in interface Dialect
generateOrderItem
in class JdbcDialectImpl
expr
- Expressionnullable
- Whether expression may have NULL valuesascending
- Whether to sort expression ascending
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |