Top Description Constructors Methods
org.hibernate.boot.model.internal

public Class SoftDeleteHelper

extends Object
Class Inheritance
Imports
org.hibernate.annotations.SoftDelete, org.hibernate.boot.model.convert.internal.ClassBasedConverterDescriptor, org.hibernate.boot.model.naming.Identifier, .PhysicalNamingStrategy, org.hibernate.boot.model.relational.Database, org.hibernate.boot.spi.MetadataBuildingContext, org.hibernate.dialect.Dialect, org.hibernate.mapping.BasicValue, .Column, .SoftDeletable, .Table, org.hibernate.metamodel.mapping.SoftDeletableModelPart, .SoftDeleteMapping, org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess, .SoftDeleteMappingImpl, org.hibernate.sql.ast.spi.SqlExpressionResolver, org.hibernate.sql.ast.tree.expression.ColumnReference, .Expression, .JdbcLiteral, org.hibernate.sql.ast.tree.from.TableReference, org.hibernate.sql.ast.tree.predicate.ComparisonPredicate, .Predicate, org.hibernate.sql.ast.tree.update.Assignment, org.hibernate.type.descriptor.converter.spi.BasicValueConverter, org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter

Helper for dealing with org.hibernate.annotations.SoftDelete
Author
Steve Ebersole

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
applyColumnName(Column softDeleteColumn, SoftDelete softDeleteConfig, MetadataBuildingContext context)

public static void
bindSoftDeleteIndicator(SoftDelete
The SoftDelete annotation
softDeleteConfig
,
SoftDeletable
The thing which is to be soft-deleted
target
,
Table
The table to which the soft-delete should be applied
table
,
MetadataBuildingContext
The processing context for access to needed info and services
context
)

Creates and binds the column and value for modeling the soft-delete in the database

public static Predicate
createNonSoftDeletedRestriction(TableReference
The table reference for the table containing the soft-delete column
tableReference
,
SoftDeleteMapping
The soft-delete mapping
softDeleteMapping
)

Create a SQL AST Predicate for restricting matches to non-deleted rows

public static Predicate
createNonSoftDeletedRestriction(TableReference
The table reference for the table containing the soft-delete column
tableReference
,
SoftDeleteMapping
The soft-delete mapping
softDeleteMapping
,
SqlExpressionResolver expressionResolver)

Create a SQL AST Predicate for restricting matches to non-deleted rows

public static Assignment
createSoftDeleteAssignment(TableReference
The table reference for the table containing the soft-delete column
tableReference
,
SoftDeleteMapping
The soft-delete mapping
softDeleteMapping
)

Create a SQL AST Assignment for setting the soft-delete column to its deleted indicate value

private static Column
createSoftDeleteIndicatorColumn(SoftDelete softDeleteConfig, BasicValue softDeleteIndicatorValue, MetadataBuildingContext context)

private static BasicValue
public static SoftDeleteMappingImpl
resolveSoftDeleteMapping(SoftDeletableModelPart softDeletableModelPart, SoftDeletable bootMapping, String tableName, MappingModelCreationProcess creationProcess)

public static SoftDeleteMappingImpl
resolveSoftDeleteMapping(SoftDeletableModelPart softDeletableModelPart, SoftDeletable bootMapping, String tableName, Dialect dialect)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SoftDeleteHelperback to summary
public SoftDeleteHelper()

Method Detail

applyColumnNameback to summary
private static void applyColumnName(Column softDeleteColumn, SoftDelete softDeleteConfig, MetadataBuildingContext context)
bindSoftDeleteIndicatorback to summary
public static void bindSoftDeleteIndicator(SoftDelete softDeleteConfig, SoftDeletable target, Table table, MetadataBuildingContext context)

Creates and binds the column and value for modeling the soft-delete in the database

Parameters
softDeleteConfig:SoftDelete

The SoftDelete annotation

target:SoftDeletable

The thing which is to be soft-deleted

table:Table

The table to which the soft-delete should be applied

context:MetadataBuildingContext

The processing context for access to needed info and services

createNonSoftDeletedRestrictionback to summary
public static Predicate createNonSoftDeletedRestriction(TableReference tableReference, SoftDeleteMapping softDeleteMapping)

Create a SQL AST Predicate for restricting matches to non-deleted rows

Parameters
tableReference:TableReference

The table reference for the table containing the soft-delete column

softDeleteMapping:SoftDeleteMapping

The soft-delete mapping

createNonSoftDeletedRestrictionback to summary
public static Predicate createNonSoftDeletedRestriction(TableReference tableReference, SoftDeleteMapping softDeleteMapping, SqlExpressionResolver expressionResolver)

Create a SQL AST Predicate for restricting matches to non-deleted rows

Parameters
tableReference:TableReference

The table reference for the table containing the soft-delete column

softDeleteMapping:SoftDeleteMapping

The soft-delete mapping

createSoftDeleteAssignmentback to summary
public static Assignment createSoftDeleteAssignment(TableReference tableReference, SoftDeleteMapping softDeleteMapping)

Create a SQL AST Assignment for setting the soft-delete column to its deleted indicate value

Parameters
tableReference:TableReference

The table reference for the table containing the soft-delete column

softDeleteMapping:SoftDeleteMapping

The soft-delete mapping

createSoftDeleteIndicatorColumnback to summary
private static Column createSoftDeleteIndicatorColumn(SoftDelete softDeleteConfig, BasicValue softDeleteIndicatorValue, MetadataBuildingContext context)
createSoftDeleteIndicatorValueback to summary
private static BasicValue createSoftDeleteIndicatorValue(SoftDelete softDeleteConfig, Table table, MetadataBuildingContext context)
resolveSoftDeleteMappingback to summary
public static SoftDeleteMappingImpl resolveSoftDeleteMapping(SoftDeletableModelPart softDeletableModelPart, SoftDeletable bootMapping, String tableName, MappingModelCreationProcess creationProcess)
resolveSoftDeleteMappingback to summary
public static SoftDeleteMappingImpl resolveSoftDeleteMapping(SoftDeletableModelPart softDeletableModelPart, SoftDeletable bootMapping, String tableName, Dialect dialect)