Package org.hibernate.dialect.aggregate
Class AggregateSupportImpl
- java.lang.Object
-
- org.hibernate.dialect.aggregate.AggregateSupportImpl
-
- All Implemented Interfaces:
AggregateSupport
- Direct Known Subclasses:
DB2AggregateSupport
,OracleAggregateSupport
,PostgreSQLAggregateSupport
public class AggregateSupportImpl extends Object implements AggregateSupport
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.dialect.aggregate.AggregateSupport
AggregateSupport.AggregateColumnWriteExpression, AggregateSupport.WriteExpressionRenderer
-
-
Field Summary
Fields Modifier and Type Field Description static AggregateSupport
INSTANCE
-
Constructor Summary
Constructors Constructor Description AggregateSupportImpl()
-
Method Summary
All Methods Instance Methods Concrete 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)
WhetherAggregateSupport.aggregateCustomWriteExpressionRenderer(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.
-
-
-
Field Detail
-
INSTANCE
public static final AggregateSupport INSTANCE
-
-
Method Detail
-
aggregateComponentCustomReadExpression
public String aggregateComponentCustomReadExpression(String template, String placeholder, String aggregateParentReadExpression, String column, ColumnTypeInformation aggregateColumnType, ColumnTypeInformation columnType)
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
- 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
public String aggregateComponentAssignmentExpression(String aggregateParentAssignmentExpression, String column, ColumnTypeInformation aggregateColumnType, ColumnTypeInformation columnType)
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
- 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
public String aggregateCustomWriteExpression(ColumnTypeInformation aggregateColumnType, 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
- Parameters:
aggregateColumnType
- 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
-
preferSelectAggregateMapping
public boolean preferSelectAggregateMapping(int aggregateSqlTypeCode)
Description copied from interface:AggregateSupport
Whether to prefer selecting the aggregate column as a whole instead of individual parts.- Specified by:
preferSelectAggregateMapping
in interfaceAggregateSupport
-
preferBindAggregateMapping
public boolean preferBindAggregateMapping(int aggregateSqlTypeCode)
Description copied from interface:AggregateSupport
Whether to prefer binding the aggregate column as a whole instead of individual parts.- Specified by:
preferBindAggregateMapping
in interfaceAggregateSupport
-
aggregateCustomWriteExpressionRenderer
public AggregateSupport.WriteExpressionRenderer aggregateCustomWriteExpressionRenderer(SelectableMapping aggregateColumn, SelectableMapping[] columnsToUpdate, TypeConfiguration typeConfiguration)
- Specified by:
aggregateCustomWriteExpressionRenderer
in interfaceAggregateSupport
- Parameters:
aggregateColumn
- The mapping of the aggregate columncolumnsToUpdate
- The mappings of the columns that should be updatedtypeConfiguration
- The type configuration
-
aggregateAuxiliaryDatabaseObjects
public List<AuxiliaryDatabaseObject> aggregateAuxiliaryDatabaseObjects(Namespace namespace, String aggregatePath, ColumnTypeInformation aggregateColumnType, List<Column> aggregatedColumns)
Description copied from interface:AggregateSupport
Allows to generate auxiliary database objects for an aggregate type.- Specified by:
aggregateAuxiliaryDatabaseObjects
in interfaceAggregateSupport
-
aggregateComponentSqlTypeCode
public int aggregateComponentSqlTypeCode(int aggregateColumnSqlTypeCode, int columnSqlTypeCode)
Description copied from interface:AggregateSupport
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.- Specified by:
aggregateComponentSqlTypeCode
in interfaceAggregateSupport
- Parameters:
aggregateColumnSqlTypeCode
- TheSqlTypes
type code of the aggregate columncolumnSqlTypeCode
- TheSqlTypes
type code of the column
-
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
-
-