Top Description Fields Constructors Methods
org.hibernate.metamodel.mapping.internal

public Class SoftDeleteMappingImpl

extends Object
implements SoftDeleteMapping
Class Inheritance
All Implemented Interfaces
org.hibernate.metamodel.mapping.SoftDeleteMapping, org.hibernate.metamodel.mapping.SqlExpressible, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.metamodel.mapping.VirtualModelPart, org.hibernate.metamodel.mapping.ModelPart, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.SelectableMapping, org.hibernate.metamodel.mapping.SqlTypedMapping
Imports
java.util.function.BiConsumer, org.hibernate.cache.MutableCacheKeyBuilder, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.util.IndexedConsumer, org.hibernate.metamodel.mapping.EntityMappingType, .JdbcMapping, .MappingType, .SoftDeletableModelPart, .SoftDeleteMapping, .TableDetails, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.spi.SqlExpressionResolver, .SqlSelection, org.hibernate.sql.ast.tree.from.TableGroup, .TableReference, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, org.hibernate.sql.results.graph.basic.BasicResult, org.hibernate.type.descriptor.java.JavaType

SoftDeleteMapping implementation
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final String
private final String
private final Object
private final JdbcMapping
private final String
private final Object
public static final String
private final SoftDeletableModelPart
private final String

Constructor Summary

AccessConstructor and Description
public
SoftDeleteMappingImpl(SoftDeletableModelPart softDeletable, String columnName, String tableName, Object deletedLiteralValue, String deletedLiteralText, Object nonDeletedLiteralValue, String nonDeletedLiteralText, JdbcMapping jdbcMapping)

Method Summary

Modifier and TypeMethod and Description
public void
addToCacheKey(MutableCacheKeyBuilder
the MutableCacheKey used to add the disassembled value and the hashCode
cacheKey
,
Object
the value to disassemble
value
,
SharedSessionContractImplementor
the SharedSessionContractImplementor
session
)

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public <X, Y> int
breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

Breaks down the domain value to its constituent JDBC values.
public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for a specific reference to this ModelPart.
public Object
disassemble(Object value, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.disassemble.

Breaks down a value of J into its simple pieces.
public EntityMappingType
public <X, Y> int
public int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

Implements org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Visit each JdbcMapping starting from the given offset
public String
getColumnName()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getColumnName.

The name of the soft-delete indicator column.
public String
getDeletedLiteralText()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getDeletedLiteralText.

The String representation of the SQL literal value which indicates a deleted row
public Object
getDeletedLiteralValue()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getDeletedLiteralValue.

The SQL literal value which indicates a deleted row
public JavaType<?>
getJavaType()

Implements org.hibernate.metamodel.mapping.ModelPart.getJavaType.

The Java type for this part.
public JdbcMapping
public NavigableRole
public String
getNonDeletedLiteralText()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getNonDeletedLiteralText.

The String representation of the SQL literal value which indicates a non-deleted row
public Object
getNonDeletedLiteralValue()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getNonDeletedLiteralValue.

The SQL literal value which indicates a non-deleted row
public MappingType
public String
getPartName()

Implements org.hibernate.metamodel.mapping.ModelPart.getPartName.

The local part name, which is generally the unqualified role name
public String
public boolean
private SqlSelection
resolveSqlSelection(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

columnNameback to summary
private final String columnName
deletedLiteralTextback to summary
private final String deletedLiteralText
deletedLiteralValueback to summary
private final Object deletedLiteralValue
jdbcMappingback to summary
private final JdbcMapping jdbcMapping
nonDeletedLiteralTextback to summary
private final String nonDeletedLiteralText
nonDeletedLiteralValueback to summary
private final Object nonDeletedLiteralValue
ROLE_NAMEback to summary
public static final String ROLE_NAME
softDeletableback to summary
private final SoftDeletableModelPart softDeletable
tableNameback to summary
private final String tableName

Constructor Detail

SoftDeleteMappingImplback to summary
public SoftDeleteMappingImpl(SoftDeletableModelPart softDeletable, String columnName, String tableName, Object deletedLiteralValue, String deletedLiteralText, Object nonDeletedLiteralValue, String nonDeletedLiteralText, JdbcMapping jdbcMapping)

Method Detail

addToCacheKeyback to summary
public void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Doc from org.hibernate.metamodel.mapping.Bindable.addToCacheKey.

Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.

Parameters
cacheKey:MutableCacheKeyBuilder

the MutableCacheKey used to add the disassembled value and the hashCode

value:Object

the value to disassemble

session:SharedSessionContractImplementor

the SharedSessionContractImplementor

Annotations
@Override
applySqlSelectionsback to summary
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Doc from org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

Annotations
@Override
applySqlSelectionsback to summary
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Doc from org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

Annotations
@Override
breakDownJdbcValuesback to summary
public <X, Y> int breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X, Y> valueConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

Doc from org.hibernate.metamodel.mapping.ModelPart.breakDownJdbcValues.

Breaks down the domain value to its constituent JDBC values. Think of it as breaking the multi-dimensional array into a visitable flat array. Additionally, it passes through the values X and Y to the consumer. Returns the amount of jdbc types that have been visited.

Annotations
@Override
createDomainResultback to summary
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Doc from org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for a specific reference to this ModelPart.

Annotations
@Override
disassembleback to summary
public Object disassemble(Object value, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.disassemble.

Doc from org.hibernate.metamodel.mapping.Bindable.disassemble.

Breaks down a value of J into its simple pieces. E.g., an embedded value gets broken down into an array of its attribute state; a basic value converts to itself; etc.

Generally speaking, this is the form in which entity state is kept relative to a Session via EntityEntry.

@Entity class Person {
    @Id Integer id;
    @Embedded Name name;
    int age;
}

@Embeddable class Name {
    String familiarName;
    String familyName;
}

At the top level, we would want to disassemble a Person value, so we'd ask the Bindable for the Person entity to disassemble. Given a Person value:

Person( id=1, name=Name( 'Steve', 'Ebersole' ), 28 )

this disassemble would result in a multidimensional array:

[ ["Steve", "Ebersole"], 28 ]

Note that the identifier is not part of this disassembled state. Note also how the embedded value results in a sub-array.

Annotations
@Override
findContainingEntityMappingback to summary
public EntityMappingType findContainingEntityMapping()

Implements org.hibernate.metamodel.mapping.ModelPart.findContainingEntityMapping.

Annotations
@Override
forEachDisassembledJdbcValueback to summary
public <X, Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X, Y> valuesConsumer, SharedSessionContractImplementor session)

Implements org.hibernate.metamodel.mapping.Bindable.forEachDisassembledJdbcValue.

Doc from org.hibernate.metamodel.mapping.Bindable.forEachDisassembledJdbcValue.

Like forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), but additionally receives an offset by which the selectionIndex is incremented when calling JdbcValuesBiConsumer#consume(int, Object, Object, Object, JdbcMapping).

Annotations
@Override
forEachJdbcTypeback to summary
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)

Implements org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Doc from org.hibernate.metamodel.mapping.JdbcMappingContainer.forEachJdbcType.

Visit each JdbcMapping starting from the given offset

Annotations
@Override
getColumnNameback to summary
public String getColumnName()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getColumnName.

Doc from org.hibernate.metamodel.mapping.SoftDeleteMapping.getColumnName.

The name of the soft-delete indicator column.

Annotations
@Override
getDeletedLiteralTextback to summary
public String getDeletedLiteralText()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getDeletedLiteralText.

Doc from org.hibernate.metamodel.mapping.SoftDeleteMapping.getDeletedLiteralText.

The String representation of the SQL literal value which indicates a deleted row

Annotations
@Override
getDeletedLiteralValueback to summary
public Object getDeletedLiteralValue()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getDeletedLiteralValue.

Doc from org.hibernate.metamodel.mapping.SoftDeleteMapping.getDeletedLiteralValue.

The SQL literal value which indicates a deleted row

Annotations
@Override
getJavaTypeback to summary
public JavaType<?> getJavaType()

Implements org.hibernate.metamodel.mapping.ModelPart.getJavaType.

Doc from org.hibernate.metamodel.mapping.ModelPart.getJavaType.

The Java type for this part. Generally equivalent to MappingType#getMappedJavaType() relative to getPartMappingType()

Annotations
@Override
getJdbcMappingback to summary
public JdbcMapping getJdbcMapping()

Implements org.hibernate.metamodel.mapping.SqlTypedMapping.getJdbcMapping, org.hibernate.metamodel.mapping.SqlExpressible.getJdbcMapping.

Doc from org.hibernate.metamodel.mapping.SqlExpressible.getJdbcMapping.

Anything that is expressible at the SQL AST level would be of basic type.

Annotations
@Override
getNavigableRoleback to summary
public NavigableRole getNavigableRole()

Implements org.hibernate.metamodel.mapping.ModelPart.getNavigableRole.

Annotations
@Override
getNonDeletedLiteralTextback to summary
public String getNonDeletedLiteralText()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getNonDeletedLiteralText.

Doc from org.hibernate.metamodel.mapping.SoftDeleteMapping.getNonDeletedLiteralText.

The String representation of the SQL literal value which indicates a non-deleted row

Annotations
@Override
getNonDeletedLiteralValueback to summary
public Object getNonDeletedLiteralValue()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getNonDeletedLiteralValue.

Doc from org.hibernate.metamodel.mapping.SoftDeleteMapping.getNonDeletedLiteralValue.

The SQL literal value which indicates a non-deleted row

Annotations
@Override
getPartMappingTypeback to summary
public MappingType getPartMappingType()

Implements org.hibernate.metamodel.mapping.ModelPart.getPartMappingType.

Doc from org.hibernate.metamodel.mapping.ModelPart.getPartMappingType.

The type for this part.

Annotations
@Override
getPartNameback to summary
public String getPartName()

Implements org.hibernate.metamodel.mapping.ModelPart.getPartName.

Doc from org.hibernate.metamodel.mapping.ModelPart.getPartName.

The local part name, which is generally the unqualified role name

Annotations
@Override
getTableNameback to summary
public String getTableName()

Implements org.hibernate.metamodel.mapping.SoftDeleteMapping.getTableName.

Doc from org.hibernate.metamodel.mapping.SoftDeleteMapping.getTableName.

The name of the table which holds the indicator column

Annotations
@Override
hasPartitionedSelectionMappingback to summary
public boolean hasPartitionedSelectionMapping()

Implements org.hibernate.metamodel.mapping.ModelPart.hasPartitionedSelectionMapping.

Annotations
@Override
resolveSqlSelectionback to summary
private SqlSelection resolveSqlSelection(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override