Top Description Inners Methods
org.hibernate.dialect.aggregate

public Interface AggregateSupport

Known Direct Implementers
org.hibernate.dialect.aggregate.AggregateSupportImpl
Annotations
@Incubating
Imports
java.util.List, org.hibernate.Incubating, org.hibernate.boot.model.relational.AuxiliaryDatabaseObject, .Namespace, org.hibernate.dialect.Dialect, org.hibernate.mapping.Column, org.hibernate.metamodel.mapping.SelectableMapping, org.hibernate.sql.ast.SqlAstTranslator, org.hibernate.sql.ast.spi.SqlAppender, org.hibernate.sql.ast.tree.expression.Expression, org.hibernate.tool.schema.extract.spi.ColumnTypeInformation, org.hibernate.type.spi.TypeConfiguration

A set of operations providing support for aggregate column types in a certain SQL dialect.
Since
6.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
AggregateSupport.AggregateColumnWriteExpression

The actual write expression for an aggregate column which gives access to the value expressions for the respective selectable mapping.

public 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 the aggregateColumnWriteExpression.

Method Summary

Modifier and TypeMethod and Description
public List<AuxiliaryDatabaseObject>
aggregateAuxiliaryDatabaseObjects(Namespace namespace, String aggregatePath, ColumnTypeInformation aggregateColumnType, List<Column> aggregatedColumns)

Allows to generate auxiliary database objects for an aggregate type.

public String
aggregateComponentAssignmentExpression(String
The expression to the aggregate column, which contains the column
aggregateParentAssignmentExpression
,
String
The column within the aggregate type, for which to return the assignment expression
column
,
ColumnTypeInformation
The type information for the aggregate column
aggregateColumnType
,
ColumnTypeInformation
The type information for the column within the aggregate type
columnType
)

Returns the assignment expression to use for column, which is part of the aggregate type of aggregatePath.

public String
aggregateComponentCustomReadExpression(String
The custom read expression template of the column
template
,
String
The placeholder to replace with the actual read expression
placeholder
,
String
The expression to the aggregate column, which contains the column
aggregateParentReadExpression
,
String
The column within the aggregate type, for which to return the read expression
column
,
ColumnTypeInformation
The type information for the aggregate column
aggregateColumnType
,
ColumnTypeInformation
The type information for the column within the aggregate type
columnType
)

Returns the custom read expression to use for column.

public int
aggregateComponentSqlTypeCode(int
The org.hibernate.type.SqlTypes type code of the aggregate column
aggregateColumnSqlTypeCode
,
int
The org.hibernate.type.SqlTypes type code of the column
columnSqlTypeCode
)

Returns the org.hibernate.type.SqlTypes type code to use for the given column type code, when aggregated within a column of the given aggregate column type code.

public String
aggregateCustomWriteExpression(ColumnTypeInformation
The type information for the aggregate column
aggregateColumnType
,
List<Column>
The columns of the aggregate type
aggregatedColumns
)

Returns the custom write expression to use for an aggregate column of the given column type, containing the given aggregated columns.

public AggregateSupport.WriteExpressionRenderer
aggregateCustomWriteExpressionRenderer(SelectableMapping
The mapping of the aggregate column
aggregateColumn
,
SelectableMapping[]
The mappings of the columns that should be updated
columnsToUpdate
,
TypeConfiguration
The type configuration
typeConfiguration
)

public boolean
preferBindAggregateMapping(int aggregateSqlTypeCode)

Whether to prefer binding the aggregate column as a whole instead of individual parts.

public boolean
preferSelectAggregateMapping(int aggregateSqlTypeCode)

Whether to prefer selecting the aggregate column as a whole instead of individual parts.

public boolean
requiresAggregateCustomWriteExpressionRenderer(int aggregateSqlTypeCode)

Whether aggregateCustomWriteExpressionRenderer(SelectableMapping, SelectableMapping[], TypeConfiguration) is needed when assigning an expression to individual aggregated columns in an update statement.

public 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

aggregateAuxiliaryDatabaseObjectsback to summary
public List<AuxiliaryDatabaseObject> aggregateAuxiliaryDatabaseObjects(Namespace namespace, String aggregatePath, ColumnTypeInformation aggregateColumnType, List<Column> aggregatedColumns)

Allows to generate auxiliary database objects for an aggregate type.

aggregateComponentAssignmentExpressionback to summary
public String aggregateComponentAssignmentExpression(String aggregateParentAssignmentExpression, String column, ColumnTypeInformation aggregateColumnType, ColumnTypeInformation columnType)

Returns the assignment expression to use for column, which is part of the aggregate type of aggregatePath.

Parameters
aggregateParentAssignmentExpression:String

The expression to the aggregate column, which contains the column

column:String

The column within the aggregate type, for which to return the assignment expression

aggregateColumnType:ColumnTypeInformation

The type information for the aggregate column

columnType:ColumnTypeInformation

The type information for the column within the aggregate type

aggregateComponentCustomReadExpressionback to summary
public String aggregateComponentCustomReadExpression(String template, String placeholder, String aggregateParentReadExpression, String column, ColumnTypeInformation aggregateColumnType, ColumnTypeInformation columnType)

Returns the custom read expression to use for column. Replaces the given placeholder in the given template by the custom read expression to use for column.

Parameters
template:String

The custom read expression template of the column

placeholder:String

The placeholder to replace with the actual read expression

aggregateParentReadExpression:String

The expression to the aggregate column, which contains the column

column:String

The column within the aggregate type, for which to return the read expression

aggregateColumnType:ColumnTypeInformation

The type information for the aggregate column

columnType:ColumnTypeInformation

The type information for the column within the aggregate type

aggregateComponentSqlTypeCodeback to summary
public int aggregateComponentSqlTypeCode(int aggregateColumnSqlTypeCode, int columnSqlTypeCode)

Returns the org.hibernate.type.SqlTypes 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 of boolean within an object/struct type.

Parameters
aggregateColumnSqlTypeCode:int

The org.hibernate.type.SqlTypes type code of the aggregate column

columnSqlTypeCode:int

The org.hibernate.type.SqlTypes type code of the column

aggregateCustomWriteExpressionback to summary
public 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:ColumnTypeInformation

The type information for the aggregate column

aggregatedColumns:List<Column>

The columns of the aggregate type

aggregateCustomWriteExpressionRendererback to summary
public AggregateSupport.WriteExpressionRenderer aggregateCustomWriteExpressionRenderer(SelectableMapping aggregateColumn, SelectableMapping[] columnsToUpdate, TypeConfiguration typeConfiguration)
Parameters
aggregateColumn:SelectableMapping

The mapping of the aggregate column

columnsToUpdate:SelectableMapping[]

The mappings of the columns that should be updated

typeConfiguration:TypeConfiguration

The type configuration

preferBindAggregateMappingback to summary
public boolean preferBindAggregateMapping(int aggregateSqlTypeCode)

Whether to prefer binding the aggregate column as a whole instead of individual parts.

preferSelectAggregateMappingback to summary
public boolean preferSelectAggregateMapping(int aggregateSqlTypeCode)

Whether to prefer selecting the aggregate column as a whole instead of individual parts.

requiresAggregateCustomWriteExpressionRendererback to summary
public boolean requiresAggregateCustomWriteExpressionRenderer(int aggregateSqlTypeCode)

Whether aggregateCustomWriteExpressionRenderer(SelectableMapping, SelectableMapping[], TypeConfiguration) is needed when assigning an expression to individual aggregated columns in an update statement.

supportsComponentCheckConstraintsback to summary
public 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.

org.hibernate.dialect.aggregate back to summary

public Interface AggregateSupport.AggregateColumnWriteExpression

Known Direct Implementers
org.hibernate.sql.ast.tree.expression.AggregateColumnWriteExpression

The actual write expression for an aggregate column which gives access to the value expressions for the respective selectable mapping.

Method Summary

Modifier and TypeMethod and Description
public Expression
getValueExpression(SelectableMapping selectableMapping)

Returns the value expression to assign to the given selectable mapping, or throws an IllegalArgumentException when an invalid selectable mapping is passed.

Method Detail

getValueExpressionback to summary
public Expression getValueExpression(SelectableMapping selectableMapping)

Returns the value expression to assign to the given selectable mapping, or throws an IllegalArgumentException when an invalid selectable mapping is passed.

org.hibernate.dialect.aggregate back to summary

public Interface AggregateSupport.WriteExpressionRenderer

Known Direct Implementers
org.hibernate.dialect.aggregate.DB2AggregateSupport.RootStructWriteExpression, org.hibernate.dialect.aggregate.OracleAggregateSupport.RootJsonWriteExpression, org.hibernate.dialect.aggregate.PostgreSQLAggregateSupport.RootJsonWriteExpression

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 the aggregateColumnWriteExpression.

Method Summary

Modifier and TypeMethod and Description
public void
render(SqlAppender sqlAppender, SqlAstTranslator<?> translator, AggregateSupport.AggregateColumnWriteExpression aggregateColumnWriteExpression, String qualifier)

Renders the qualified custom write expression to the SqlAppender with the value expressions for each selectable as returned by AggregateColumnWriteExpression#getValueExpression(SelectableMapping).

Method Detail

renderback to summary
public void render(SqlAppender sqlAppender, SqlAstTranslator<?> translator, AggregateSupport.AggregateColumnWriteExpression aggregateColumnWriteExpression, String qualifier)

Renders the qualified custom write expression to the SqlAppender with the value expressions for each selectable as returned by AggregateColumnWriteExpression#getValueExpression(SelectableMapping).