Package org.hibernate.dialect.aggregate
Class SybaseASEAggregateSupport
java.lang.Object
org.hibernate.dialect.aggregate.AggregateSupportImpl
org.hibernate.dialect.aggregate.SybaseASEAggregateSupport
- All Implemented Interfaces:
AggregateSupport
Sybase ASE supports the
xmlextract()
function which is used to implement aggregate support.
One notable quirk of Sybase ASE that causes a lot of ugly code is that a SQL NULL
in string concatenation
is treated as empty string and hence does not produce NULL
.
So in order to get correct results, it is necessary to wrap concatenation expressions with case expressions,
that ensure NULL
is produced if any of the concatenation expressions is NULL
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.dialect.aggregate.AggregateSupport
AggregateSupport.AggregateColumnWriteExpression, AggregateSupport.WriteExpressionRenderer
-
Method Summary
Modifier and TypeMethodDescriptionaggregateComponentAssignmentExpression
(String aggregateParentAssignmentExpression, String columnExpression, int aggregateColumnTypeCode, Column column) Returns the assignment expression to use forcolumn
, which is part of the aggregate type ofaggregatePath
.aggregateComponentCustomReadExpression
(String template, String placeholder, String aggregateParentReadExpression, String columnExpression, int aggregateColumnTypeCode, SqlTypedMapping column, TypeConfiguration typeConfiguration) Returns the custom read expression to use forcolumn
.aggregateCustomWriteExpression
(AggregateColumn aggregateColumn, List<Column> aggregatedColumns) Returns the custom write expression to use for an aggregate column of the given column type, containing the given aggregated columns.aggregateCustomWriteExpressionRenderer
(SelectableMapping aggregateColumn, SelectableMapping[] columnsToUpdate, TypeConfiguration typeConfiguration) boolean
requiresAggregateCustomWriteExpressionRenderer
(int aggregateSqlTypeCode) WhetherAggregateSupport.aggregateCustomWriteExpressionRenderer(SelectableMapping, SelectableMapping[], TypeConfiguration)
is needed when assigning an expression to individual aggregated columns in an update statement.boolean
Returns whether the database supports the use of a check constraint on tables, to implement not-null and other constraints of an aggregate type.static AggregateSupport
Methods inherited from class org.hibernate.dialect.aggregate.AggregateSupportImpl
aggregateAuxiliaryDatabaseObjects, aggregateComponentSqlTypeCode, preferBindAggregateMapping, preferSelectAggregateMapping
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.dialect.aggregate.AggregateSupport
aggregateComponentAssignmentExpression, aggregateComponentCustomReadExpression
-
Method Details
-
valueOf
-
supportsComponentCheckConstraints
public boolean supportsComponentCheckConstraints()Description copied from interface:AggregateSupport
Returns whether the database supports the use of a check constraint on tables, to implement not-null and other constraints of an aggregate type.- Specified by:
supportsComponentCheckConstraints
in interfaceAggregateSupport
- Overrides:
supportsComponentCheckConstraints
in classAggregateSupportImpl
-
aggregateComponentCustomReadExpression
public String aggregateComponentCustomReadExpression(String template, String placeholder, String aggregateParentReadExpression, String columnExpression, int aggregateColumnTypeCode, SqlTypedMapping column, TypeConfiguration typeConfiguration) Description copied from interface:AggregateSupport
Returns the custom read expression to use forcolumn
. Replaces the givenplaceholder
in the giventemplate
by the custom read expression to use forcolumn
.- Specified by:
aggregateComponentCustomReadExpression
in interfaceAggregateSupport
- Overrides:
aggregateComponentCustomReadExpression
in classAggregateSupportImpl
- Parameters:
template
- The custom read expression template of the columnplaceholder
- The placeholder to replace with the actual read expressionaggregateParentReadExpression
- The expression to the aggregate column, which contains the columncolumnExpression
- The column within the aggregate type, for which to return the read expressionaggregateColumnTypeCode
- The SQL type code of the aggregate columncolumn
- The column within the aggregate type, for which to return the read expressiontypeConfiguration
- The type configuration
-
aggregateComponentAssignmentExpression
public String aggregateComponentAssignmentExpression(String aggregateParentAssignmentExpression, String columnExpression, int aggregateColumnTypeCode, Column column) Description copied from interface:AggregateSupport
Returns the assignment expression to use forcolumn
, which is part of the aggregate type ofaggregatePath
.- Specified by:
aggregateComponentAssignmentExpression
in interfaceAggregateSupport
- Overrides:
aggregateComponentAssignmentExpression
in classAggregateSupportImpl
- Parameters:
aggregateParentAssignmentExpression
- The expression to the aggregate column, which contains the columncolumnExpression
- The column within the aggregate type, for which to return the assignment expressionaggregateColumnTypeCode
- The SQL type code of the aggregate columncolumn
- The column within the aggregate type, for which to return the assignment expression
-
aggregateCustomWriteExpression
public String aggregateCustomWriteExpression(AggregateColumn aggregateColumn, List<Column> aggregatedColumns) Description copied from interface:AggregateSupport
Returns the custom write expression to use for an aggregate column of the given column type, containing the given aggregated columns.- Specified by:
aggregateCustomWriteExpression
in interfaceAggregateSupport
- Overrides:
aggregateCustomWriteExpression
in classAggregateSupportImpl
- Parameters:
aggregateColumn
- The type information for the aggregate columnaggregatedColumns
- The columns of the aggregate type
-
requiresAggregateCustomWriteExpressionRenderer
public boolean requiresAggregateCustomWriteExpressionRenderer(int aggregateSqlTypeCode) Description copied from interface:AggregateSupport
WhetherAggregateSupport.aggregateCustomWriteExpressionRenderer(SelectableMapping, SelectableMapping[], TypeConfiguration)
is needed when assigning an expression to individual aggregated columns in an update statement.- Specified by:
requiresAggregateCustomWriteExpressionRenderer
in interfaceAggregateSupport
- Overrides:
requiresAggregateCustomWriteExpressionRenderer
in classAggregateSupportImpl
-
aggregateCustomWriteExpressionRenderer
public AggregateSupport.WriteExpressionRenderer aggregateCustomWriteExpressionRenderer(SelectableMapping aggregateColumn, SelectableMapping[] columnsToUpdate, TypeConfiguration typeConfiguration) - Specified by:
aggregateCustomWriteExpressionRenderer
in interfaceAggregateSupport
- Overrides:
aggregateCustomWriteExpressionRenderer
in classAggregateSupportImpl
- Parameters:
aggregateColumn
- The mapping of the aggregate columncolumnsToUpdate
- The mappings of the columns that should be updatedtypeConfiguration
- The type configuration
-