Package org.hibernate.dialect.aggregate
Interface AggregateSupport
-
- All Known Implementing Classes:
AggregateSupportImpl
,DB2AggregateSupport
,OracleAggregateSupport
,PostgreSQLAggregateSupport
public interface AggregateSupport
A set of operations providing support for aggregate column types in a certainSQL dialect
.- Since:
- 6.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
AggregateSupport.AggregateColumnWriteExpression
The actual write expression for an aggregate column which gives access to the value expressions for the respective selectable mapping.static interface
AggregateSupport.WriteExpressionRenderer
Contract for rendering the custom write expression that updates a selected set of aggregated columns within an aggregate column to the value expressions as given by theaggregateColumnWriteExpression
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<AuxiliaryDatabaseObject>
aggregateAuxiliaryDatabaseObjects(Namespace namespace, String aggregatePath, ColumnTypeInformation aggregateColumnType, List<Column> aggregatedColumns)
Allows to generate auxiliary database objects for an aggregate type.String
aggregateComponentAssignmentExpression(String aggregateParentAssignmentExpression, String column, ColumnTypeInformation aggregateColumnType, ColumnTypeInformation columnType)
Returns the assignment expression to use forcolumn
, which is part of the aggregate type ofaggregatePath
.String
aggregateComponentCustomReadExpression(String template, String placeholder, String aggregateParentReadExpression, String column, ColumnTypeInformation aggregateColumnType, ColumnTypeInformation columnType)
Returns the custom read expression to use forcolumn
.int
aggregateComponentSqlTypeCode(int aggregateColumnSqlTypeCode, int columnSqlTypeCode)
Returns theSqlTypes
type code to use for the given column type code, when aggregated within a column of the given aggregate column type code.String
aggregateCustomWriteExpression(ColumnTypeInformation aggregateColumnType, List<Column> aggregatedColumns)
Returns the custom write expression to use for an aggregate column of the given column type, containing the given aggregated columns.AggregateSupport.WriteExpressionRenderer
aggregateCustomWriteExpressionRenderer(SelectableMapping aggregateColumn, SelectableMapping[] columnsToUpdate, TypeConfiguration typeConfiguration)
boolean
preferBindAggregateMapping(int aggregateSqlTypeCode)
Whether to prefer binding the aggregate column as a whole instead of individual parts.boolean
preferSelectAggregateMapping(int aggregateSqlTypeCode)
Whether to prefer selecting the aggregate column as a whole instead of individual parts.boolean
requiresAggregateCustomWriteExpressionRenderer(int aggregateSqlTypeCode)
WhetheraggregateCustomWriteExpressionRenderer(SelectableMapping, SelectableMapping[], TypeConfiguration)
is needed when assigning an expression to individual aggregated columns in an update statement.boolean
supportsComponentCheckConstraints()
Returns whether the database supports the use of a check constraint on tables, to implement not-null and other constraints of an aggregate type.
-
-
-
Method Detail
-
aggregateComponentCustomReadExpression
String aggregateComponentCustomReadExpression(String template, String placeholder, String aggregateParentReadExpression, String column, ColumnTypeInformation aggregateColumnType, ColumnTypeInformation columnType)
Returns the custom read expression to use forcolumn
. Replaces the givenplaceholder
in the giventemplate
by the custom read expression to use forcolumn
.- 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 columncolumn
- The column within the aggregate type, for which to return the read expressionaggregateColumnType
- The type information for the aggregate columncolumnType
- The type information for the column within the aggregate type
-
aggregateComponentAssignmentExpression
String aggregateComponentAssignmentExpression(String aggregateParentAssignmentExpression, String column, ColumnTypeInformation aggregateColumnType, ColumnTypeInformation columnType)
Returns the assignment expression to use forcolumn
, which is part of the aggregate type ofaggregatePath
.- Parameters:
aggregateParentAssignmentExpression
- The expression to the aggregate column, which contains the columncolumn
- The column within the aggregate type, for which to return the assignment expressionaggregateColumnType
- The type information for the aggregate columncolumnType
- The type information for the column within the aggregate type
-
aggregateCustomWriteExpression
String aggregateCustomWriteExpression(ColumnTypeInformation aggregateColumnType, List<Column> aggregatedColumns)
Returns the custom write expression to use for an aggregate column of the given column type, containing the given aggregated columns.- Parameters:
aggregateColumnType
- The type information for the aggregate columnaggregatedColumns
- The columns of the aggregate type
-
requiresAggregateCustomWriteExpressionRenderer
boolean requiresAggregateCustomWriteExpressionRenderer(int aggregateSqlTypeCode)
WhetheraggregateCustomWriteExpressionRenderer(SelectableMapping, SelectableMapping[], TypeConfiguration)
is needed when assigning an expression to individual aggregated columns in an update statement.
-
preferSelectAggregateMapping
boolean preferSelectAggregateMapping(int aggregateSqlTypeCode)
Whether to prefer selecting the aggregate column as a whole instead of individual parts.
-
preferBindAggregateMapping
boolean preferBindAggregateMapping(int aggregateSqlTypeCode)
Whether to prefer binding the aggregate column as a whole instead of individual parts.
-
aggregateCustomWriteExpressionRenderer
AggregateSupport.WriteExpressionRenderer aggregateCustomWriteExpressionRenderer(SelectableMapping aggregateColumn, SelectableMapping[] columnsToUpdate, TypeConfiguration typeConfiguration)
- Parameters:
aggregateColumn
- The mapping of the aggregate columncolumnsToUpdate
- The mappings of the columns that should be updatedtypeConfiguration
- The type configuration
-
aggregateAuxiliaryDatabaseObjects
List<AuxiliaryDatabaseObject> aggregateAuxiliaryDatabaseObjects(Namespace namespace, String aggregatePath, ColumnTypeInformation aggregateColumnType, List<Column> aggregatedColumns)
Allows to generate auxiliary database objects for an aggregate type.
-
aggregateComponentSqlTypeCode
int aggregateComponentSqlTypeCode(int aggregateColumnSqlTypeCode, int columnSqlTypeCode)
Returns theSqlTypes
type code to use for the given column type code, when aggregated within a column of the given aggregate column type code. Allows to change types when a database does not allow to use certain types within an aggregate type, like DB2 doesn't allow the use ofboolean
within an object/struct type.
-
supportsComponentCheckConstraints
boolean supportsComponentCheckConstraints()
Returns whether the database supports the use of a check constraint on tables, to implement not-null and other constraints of an aggregate type.
-
-