Class SoftDeleteMappingImpl
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.SoftDeleteMappingImpl
-
- All Implemented Interfaces:
Bindable,JdbcMappingContainer,MappingModelExpressible,ModelPart,SelectableMapping,SoftDeleteMapping,SqlExpressible,SqlTypedMapping,VirtualModelPart
public class SoftDeleteMappingImpl extends Object implements SoftDeleteMapping
SoftDeleteMapping implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,Y>, Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,Y>, ModelPart.JdbcValueConsumer
-
-
Constructor Summary
Constructors Constructor Description SoftDeleteMappingImpl(SoftDeletableModelPart softDeletable, String columnName, String tableName, Object deletedLiteralValue, String deletedLiteralText, Object nonDeletedLiteralValue, String nonDeletedLiteralText, JdbcMapping jdbcMapping)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)Add to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.voidapplySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.<X,Y>
intbreakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)Breaks down the domain value to its constituent JDBC values.<T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for a specific reference to this ModelPart.Objectdisassemble(Object value, SharedSessionContractImplementor session)Breaks down a value ofJinto its simple pieces.EntityMappingTypefindContainingEntityMapping()<X,Y>
intforEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)LikeBindable.forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), but additionally receives an offset by which the selectionIndex is incremented when callingBindable.JdbcValuesBiConsumer.consume(int, Object, Object, Object, JdbcMapping).intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Visit each JdbcMapping starting from the given offsetStringgetColumnName()The name of the soft-delete indicator column.StringgetDeletedLiteralText()The String representation of the SQL literal value which indicates a deleted rowObjectgetDeletedLiteralValue()The SQL literal value which indicates a deleted rowJavaType<?>getJavaType()The Java type for this part.JdbcMappinggetJdbcMapping()Anything that is expressible at the SQL AST level would be of basic type.NavigableRolegetNavigableRole()StringgetNonDeletedLiteralText()The String representation of the SQL literal value which indicates a non-deleted rowObjectgetNonDeletedLiteralValue()The SQL literal value which indicates a non-deleted rowMappingTypegetPartMappingType()The type for this part.StringgetPartName()The local part name, which is generally the unqualified role nameStringgetTableName()The name of the table which holds the indicator columnbooleanhasPartitionedSelectionMapping()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, getJdbcTypeCount
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, asBasicValuedModelPart, asEntityMappingType, breakDownJdbcValues, decompose, decompose, forEachSelectable, forEachSelectable, isEntityIdentifierMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.SelectableMapping
getSelectablePath
-
Methods inherited from interface org.hibernate.metamodel.mapping.SoftDeleteMapping
getColumnDefinition, getContainingTableExpression, getCustomReadExpression, getCustomWriteExpression, getLength, getPrecision, getScale, getSelectableName, getSelectionExpression, getTemporalPrecision, getWriteExpression, isFormula, isInsertable, isNullable, isPartitioned, isUpdateable
-
Methods inherited from interface org.hibernate.metamodel.mapping.SqlExpressible
getJdbcMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.SqlTypedMapping
isLob, toSize
-
Methods inherited from interface org.hibernate.metamodel.mapping.VirtualModelPart
isVirtual
-
-
-
-
Field Detail
-
ROLE_NAME
public static final String ROLE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SoftDeleteMappingImpl
public SoftDeleteMappingImpl(SoftDeletableModelPart softDeletable, String columnName, String tableName, Object deletedLiteralValue, String deletedLiteralText, Object nonDeletedLiteralValue, String nonDeletedLiteralText, JdbcMapping jdbcMapping)
-
-
Method Detail
-
getColumnName
public String getColumnName()
Description copied from interface:SoftDeleteMappingThe name of the soft-delete indicator column.- Specified by:
getColumnNamein interfaceSoftDeleteMapping
-
getTableName
public String getTableName()
Description copied from interface:SoftDeleteMappingThe name of the table which holds the indicator column- Specified by:
getTableNamein interfaceSoftDeleteMapping
-
getDeletedLiteralValue
public Object getDeletedLiteralValue()
Description copied from interface:SoftDeleteMappingThe SQL literal value which indicates a deleted row- Specified by:
getDeletedLiteralValuein interfaceSoftDeleteMapping
-
getDeletedLiteralText
public String getDeletedLiteralText()
Description copied from interface:SoftDeleteMappingThe String representation of the SQL literal value which indicates a deleted row- Specified by:
getDeletedLiteralTextin interfaceSoftDeleteMapping
-
getNonDeletedLiteralValue
public Object getNonDeletedLiteralValue()
Description copied from interface:SoftDeleteMappingThe SQL literal value which indicates a non-deleted row- Specified by:
getNonDeletedLiteralValuein interfaceSoftDeleteMapping
-
getNonDeletedLiteralText
public String getNonDeletedLiteralText()
Description copied from interface:SoftDeleteMappingThe String representation of the SQL literal value which indicates a non-deleted row- Specified by:
getNonDeletedLiteralTextin interfaceSoftDeleteMapping
-
getJdbcMapping
public JdbcMapping getJdbcMapping()
Description copied from interface:SqlExpressibleAnything that is expressible at the SQL AST level would be of basic type.- Specified by:
getJdbcMappingin interfaceSqlExpressible- Specified by:
getJdbcMappingin interfaceSqlTypedMapping
-
getPartName
public String getPartName()
Description copied from interface:ModelPartThe local part name, which is generally the unqualified role name- Specified by:
getPartNamein interfaceModelPart
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRolein interfaceModelPart- See Also:
ModelPart.getPartName()
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
Description copied from interface:BindableBreaks down a value ofJinto 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
Personvalue, so we'd ask theBindablefor thePersonentity to disassemble. Given aPersonvalue: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.
- Specified by:
disassemblein interfaceBindable- See Also:
EntityEntry
-
addToCacheKey
public void addToCacheKey(MutableCacheKeyBuilder cacheKey, Object value, SharedSessionContractImplementor session)
Description copied from interface:BindableAdd to the MutableCacheKey the values obtained disassembling the value and the hasCode generated from the disassembled value.- Specified by:
addToCacheKeyin interfaceBindable- Parameters:
cacheKey- the MutableCacheKey used to add the disassembled value and the hashCodevalue- the value to disassemblesession- the SharedSessionContractImplementor
-
forEachDisassembledJdbcValue
public <X,Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)
Description copied from interface:BindableLikeBindable.forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor), but additionally receives an offset by which the selectionIndex is incremented when callingBindable.JdbcValuesBiConsumer.consume(int, Object, Object, Object, JdbcMapping).- Specified by:
forEachDisassembledJdbcValuein interfaceBindable
-
getPartMappingType
public MappingType getPartMappingType()
Description copied from interface:ModelPartThe type for this part.- Specified by:
getPartMappingTypein interfaceModelPart
-
getJavaType
public JavaType<?> getJavaType()
Description copied from interface:ModelPartThe Java type for this part. Generally equivalent toMappingType.getMappedJavaType()relative toModelPart.getPartMappingType()- Specified by:
getJavaTypein interfaceModelPart
-
hasPartitionedSelectionMapping
public boolean hasPartitionedSelectionMapping()
- Specified by:
hasPartitionedSelectionMappingin interfaceModelPart
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPartCreate a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResultin interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPartApply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelectionsin interfaceModelPart
-
breakDownJdbcValues
public <X,Y> int breakDownJdbcValues(Object domainValue, int offset, X x, Y y, ModelPart.JdbcValueBiConsumer<X,Y> valueConsumer, SharedSessionContractImplementor session)
Description copied from interface:ModelPartBreaks 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 valuesXandYto the consumer. Returns the amount of jdbc types that have been visited.- Specified by:
breakDownJdbcValuesin interfaceModelPart
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
-