Package mondrian.spi.impl
Class DerbyDialect
- java.lang.Object
-
- mondrian.spi.impl.JdbcDialectImpl
-
- mondrian.spi.impl.DerbyDialect
-
- All Implemented Interfaces:
Dialect
public class DerbyDialect extends JdbcDialectImpl
Implementation ofDialect
for the Apache Derby database.- Since:
- Nov 23, 2008
- Author:
- jhyde
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface mondrian.spi.Dialect
Dialect.DatabaseProduct, Dialect.Datatype
-
-
Field Summary
Fields Modifier and Type Field Description static JdbcDialectFactory
FACTORY
-
Fields inherited from class mondrian.spi.impl.JdbcDialectImpl
databaseProduct, permitsSelectNotInGroupBy, productVersion
-
-
Constructor Summary
Constructors Constructor Description DerbyDialect(Connection connection)
Creates a DerbyDialect.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected void
quoteDateLiteral(StringBuilder buf, String value, Date date)
Helper method forJdbcDialectImpl.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 mondrian.spi.impl.JdbcDialectImpl
allowsAs, allowsCompoundCountDistinct, allowsCountDistinct, allowsCountDistinctWithOtherAggs, allowsDdl, allowsDialectSharing, allowsFromQuery, allowsJoinOn, allowsMultipleDistinctSqlMeasures, allowsOrderByAlias, allowsRegularExpressionInWhereClause, allowsSelectNotInGroupBy, appendHintsAfterFromClause, caseWhenElse, computeStatisticsProviders, deduceIdentifierQuoteString, deduceMaxColumnNameLength, deduceProductName, deduceProductVersion, deduceReadOnly, deduceSupportedResultSetStyles, deduceSupportsSelectNotInGroupBy, extractEmbeddedFlags, generateCountExpression, generateInlineForAnsi, generateInlineGeneric, generateOrderByNulls, generateOrderByNullsAnsi, generateOrderItem, generateRegularExpression, getDatabaseProduct, getMaxColumnNameLength, getProduct, getQuoteIdentifierString, getStatisticsProviders, getType, isDatabase, needsExponent, quote, quoteBooleanLiteral, quoteDateLiteral, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteNumericLiteral, quoteStringLiteral, quoteTimeLiteral, quoteTimestampLiteral, quoteTimestampLiteral, requiresGroupByAlias, requiresHavingAlias, requiresOrderByAlias, requiresUnionOrderByExprToBeInSelectClause, requiresUnionOrderByOrdinal, supportsGroupingSets, supportsMultiValueInExpr, supportsResultSetConcurrency, supportsUnlimitedValueList, toString, toUpper
-
-
-
-
Field Detail
-
FACTORY
public static final JdbcDialectFactory FACTORY
-
-
Constructor Detail
-
DerbyDialect
public DerbyDialect(Connection connection) throws SQLException
Creates a DerbyDialect.- Parameters:
connection
- Connection- Throws:
SQLException
-
-
Method Detail
-
quoteDateLiteral
protected void quoteDateLiteral(StringBuilder buf, String value, Date date)
Description copied from class:JdbcDialectImpl
Helper method forJdbcDialectImpl.quoteDateLiteral(StringBuilder, String)
.- Overrides:
quoteDateLiteral
in classJdbcDialectImpl
- Parameters:
buf
- Buffer to append tovalue
- Value as stringdate
- Value as date
-
requiresAliasForFromQuery
public boolean requiresAliasForFromQuery()
Description copied from interface:Dialect
Returns whether this Dialect requires subqueries in the FROM clause to have an alias.- Specified by:
requiresAliasForFromQuery
in interfaceDialect
- Overrides:
requiresAliasForFromQuery
in classJdbcDialectImpl
- Returns:
- whether dialewct requires subqueries to have an alias
- See Also:
Dialect.allowsFromQuery()
-
allowsMultipleCountDistinct
public boolean allowsMultipleCountDistinct()
Description copied from interface:Dialect
Returns whether this Dialect supports more than one distinct aggregation in the same query.In Derby 10.1,
select couunt(distinct x) from t
select couunt(distinct x), count(distinct y) from t
- Specified by:
allowsMultipleCountDistinct
in interfaceDialect
- Overrides:
allowsMultipleCountDistinct
in classJdbcDialectImpl
- Returns:
- whether this Dialect supports more than one distinct aggregation in the same query
-
generateInline
public String generateInline(List<String> columnNames, List<String> columnTypes, List<String[]> valueList)
Description copied from interface:Dialect
Generates a SQL statement to represent an inline dataset.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')
- Specified by:
generateInline
in interfaceDialect
- Overrides:
generateInline
in classJdbcDialectImpl
- Parameters:
columnNames
- List of column namescolumnTypes
- List of column types ("String" or "Numeric")valueList
- List of rows values- Returns:
- SQL string
-
supportsGroupByExpressions
public boolean supportsGroupByExpressions()
Description copied from interface:Dialect
Returns whether this Dialect supports expressions in the GROUP BY clause. Derby/Cloudscape and Infobright do not.- Specified by:
supportsGroupByExpressions
in interfaceDialect
- Overrides:
supportsGroupByExpressions
in classJdbcDialectImpl
- Returns:
- Whether this Dialect allows expressions in the GROUP BY clause
-
-