Class MockEntityPersister
java.lang.Object
org.hibernate.processor.validation.MockEntityPersister
- All Implemented Interfaces:
Loadable
,Bindable
,Discriminable
,EntityMappingType
,EntityValuedModelPart
,FilterRestrictable
,JdbcMappingContainer
,ManagedMappingType
,MappingModelExpressible
,MappingType
,ModelPart
,ModelPartContainer
,Restrictable
,SoftDeletableModelPart
,WhereRestrictable
,DiscriminatorMetadata
,EntityPersister
,Joinable
,EntityMutationTarget
,AttributeSource
,RootTableGroupProducer
,TableGroupProducer
,MutationTarget<EntityTableMapping>
,FetchableContainer
- Direct Known Subclasses:
ProcessorSessionFactory.EntityPersister
public abstract class MockEntityPersister
extends Object
implements EntityPersister, Joinable, DiscriminatorMetadata
-
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.EntityMappingType
EntityMappingType.ConstraintOrderedTableConsumer
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.JdbcValueBiConsumer<X,
Y>, ModelPart.JdbcValueConsumer -
Field Summary
Fields inherited from interface org.hibernate.persister.entity.EntityPersister
ENTITY_ID
-
Constructor Summary
ConstructorsConstructorDescriptionMockEntityPersister
(String entityName, AccessType defaultAccessType, MockSessionFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionGet the discriminator typeRetrieve the underlying entity metamodel instance.The entity name which this persister maps.Safety-net.Return theSessionFactory
to which this persister belongs.String[]
Get the names of columns used to persist the identifierOverride on subclasses!Override on subclasses!Get the name of the entity that is the "super class" for this entityString[]
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only.final Type
getPropertyType
(String propertyPath) Get the type of a particular property by name.Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class and its subclasses.Get the type used to resolve the actual discriminator value.abstract String
Returns an object that identifies the space in which identifiers of this entity hierarchy are unique.The table to join to.Retrieve the information needed to properly deal with this entity's discriminator in a query.int
IfEntityPersister.isVersioned()
, then what is the index of the property holding the locking value.BasicType<?>
Override on subclasses!protected abstract String
protected abstract Type
boolean
Determine whether instances of this entity are considered mutable.boolean
isSubclassEntityName
(String name) Determine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister.boolean
Determine whether optimistic locking by column is enabled for this entity.String[]
Given a property path, return the corresponding column name(s).toString()
protected abstract BasicType<?>
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hibernate.persister.walking.spi.AttributeSource
getPropertyIndex
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
Methods inherited from interface org.hibernate.metamodel.mapping.EntityMappingType
applyBaseRestrictions, applyDiscriminator, applyFilterRestrictions, applyWhereRestrictions, asEntityMappingType, createPrimaryTableReference, createRootTableGroup, createTableReferenceJoin, extractConcreteTypeStateValues, findContainingEntityMapping, findDeclaredAttributeMapping, findSubPart, findSubTypesSubPart, forEachAttributeMapping, getAttributeMappings, getContributor, getDeclaredAttributeMappings, getDiscriminatorMapping, getDiscriminatorSQLValue, getDiscriminatorValue, getFetchable, getIdentifierMapping, getIdentifierMappingForJoin, getIdentifierTableDetails, getJavaType, getJdbcTypeCount, getMappedJavaType, getMappedTableDetails, getNaturalIdMapping, getNumberOfAttributeMappings, getNumberOfDeclaredAttributeMappings, getNumberOfFetchables, getPartMappingType, getPartName, getRootEntityDescriptor, getRootPathName, getRowIdMapping, getSoftDeleteMapping, getSoftDeleteTableDetails, getSubclassId, getSubMappingTypes, getSuperMappingType, getVersionMapping, hasSubclasses, hasWhereRestrictions, isAbstract, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEntityGraph, isConcreteProxy, isExplicitPolymorphism, isTypeOrSuperType, isTypeOrSuperType, optimisticLockStyle, pruneForSubclasses, resolveConcreteProxyTypeForId, visitAttributeMappings, visitConstraintOrderedTables, visitDeclaredAttributeMappings, visitSubTypeAttributeMappings, visitSuperTypeAttributeMappings
Methods inherited from interface org.hibernate.persister.entity.mutation.EntityMutationTarget
addDiscriminatorToInsertGroup, addSoftDeleteToInsertGroup, getAttributeMutationTableName, getIdentifierDescriptor, getIdentifierTableMapping, getIdentityInsertDelegate, getInsertDelegate, getMutationDelegate, getTableMappings, getTargetPart, getUpdateDelegate, physicalTableNameForMutation
Methods inherited from interface org.hibernate.persister.entity.EntityPersister
addToCacheKey, afterInitialize, afterReassociate, breakDownJdbcValues, buildCacheEntry, canExtractIdOutOfEntity, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, countSubclassProperties, createProxy, delete, findDirty, findModified, forceVersionIncrement, forceVersionIncrement, getAttributeMapping, getBatchSize, getBytecodeEnhancementMetadata, getCacheAccessStrategy, getCacheEntryStructure, getConcreteProxyClass, getConstraintOrderedTableKeyColumnClosure, getCurrentVersion, getDatabaseSnapshot, getDeleteCoordinator, getDiscriminatorAlias, getDiscriminatorColumnName, getEntityEntryFactory, getEntityMappingType, getFilterAliasGenerator, getFilterAliasGenerator, getGeneratedProperties, getGenerator, getIdByUniqueKey, getIdentifier, getIdentifier, getIdentifier, getIdentifierAliases, getIdentifierGenerator, getIdentitySelectString, getImportedName, getInsertCoordinator, getInsertGeneratedProperties, getInstrumentationMetadata, getJpaEntityName, getKeyColumns, getMappedClass, getMergeCoordinator, getMultiNaturalIdLoader, getNaturalIdCacheAccessStrategy, getNaturalIdentifierProperties, getNaturalIdentifierSnapshot, getNaturalIdLoader, getNonLazyPropertyUpdateability, getPropertyAliases, getPropertyCascadeStyles, getPropertyCheckability, getPropertyColumnNames, getPropertyInsertability, getPropertyLaziness, getPropertyNames, getPropertyNullability, getPropertyTypes, getPropertyUpdateability, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesToInsert, getPropertyVersionability, getRepresentationStrategy, getRootTableIdentifierColumnNames, getRootTableKeyColumnNames, getRootTableName, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSqlAliasStem, getSqmMultiTableInsertStrategy, getSqmMultiTableMutationStrategy, getSubclassEntityPersister, getSubclassPropertyColumnAliases, getSubclassPropertyColumnNames, getSubclassTableName, getSubclassTableSpan, getSynchronizationSpaces, getSynchronizedQuerySpaces, getTableName, getTableNameForColumn, getTableNames, getTableSpan, getUpdateCoordinator, getUpdateGeneratedProperties, getValue, getValues, getVersion, getVersionColumnName, getVersionGenerator, getVersionJavaType, hasCache, hasCascadeDelete, hasCascades, hasCollectionNotReferencingPK, hasCollections, hasDuplicateTables, hasFilterForLoadByKey, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyProperties, hasMultipleTables, hasMutableProperties, hasNaturalIdCache, hasNaturalIdentifier, hasOwnedCollections, hasProxy, hasRowId, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, initializeEnhancedEntityUsedAsProxy, insert, insert, instantiate, isBatchLoadable, isCacheInvalidationRequired, isIdentifierAssignedByInsert, isInherited, isInstance, isInstrumented, isInverseTable, isLazyPropertiesCacheable, isNullableTable, isPropertySelectable, isSelectBeforeUpdateRequired, isSharedColumn, isTransient, isVersionPropertyGenerated, load, load, load, load, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, managesColumns, merge, multiLoad, postInstantiate, prepareLoaders, processInsertGeneratedProperties, processInsertGeneratedProperties, processUpdateGeneratedProperties, processUpdateGeneratedProperties, resetIdentifier, resolveAttributeIndexes, resolveDirtyAttributeIndexes, selectFragment, setIdentifier, setPropertyValue, setPropertyValues, setValue, setValues, storeDiscriminatorInShallowQueryCacheLayout, uniqueKeyEntries, update, useShallowQueryCacheLayout, visitQuerySpaces
Methods inherited from interface org.hibernate.metamodel.mapping.EntityValuedModelPart
applySqlSelections, applySqlSelections, createDomainResult, disassemble, findSubPart, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachSubPart, visitSubParts
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, getSelectableIndex, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
Methods inherited from interface org.hibernate.metamodel.mapping.FilterRestrictable
applyFilterRestrictions
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMappingContainer
getJdbcMapping, getSingleJdbcMapping
Methods inherited from interface org.hibernate.loader.ast.spi.Loadable
isAffectedByEnabledFilters, isAffectedByInfluencers, isAffectedByInfluencers, isNotAffectedByInfluencers
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
anyRequiresAggregateColumnWriter, findAttributeMapping, forEachAttributeMapping, hasPartitionedSelectionMapping, isAffectedByEnabledFilters
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, asBasicValuedModelPart, breakDownJdbcValues, decompose, decompose, forEachSelectable, forEachSelectable, getNavigableRole, isEntityIdentifierMapping, isVirtual
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, findByPath, forEachSubPart
Methods inherited from interface org.hibernate.sql.model.MutationTarget
forEachMutableTable, forEachMutableTableReverse, getIdentifierTableName, getNavigableRole, getRolePath
Methods inherited from interface org.hibernate.metamodel.mapping.Restrictable
applyBaseRestrictions
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference
-
Constructor Details
-
MockEntityPersister
public MockEntityPersister(String entityName, AccessType defaultAccessType, MockSessionFactory factory)
-
-
Method Details
-
isSubclassEntityName
Description copied from interface:EntityPersister
Determine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister.- Specified by:
isSubclassEntityName
in interfaceEntityPersister
- Parameters:
name
- The entity name to be checked.- Returns:
- True if the given entity name represents either the entity mapped by this persister or one of its subclass entities; false otherwise.
-
getFactory
Description copied from interface:EntityPersister
Return theSessionFactory
to which this persister belongs.- Specified by:
getFactory
in interfaceEntityPersister
- Returns:
- The owning
SessionFactory
.
-
getEntityMetamodel
Description copied from interface:EntityPersister
Retrieve the underlying entity metamodel instance.- Specified by:
getEntityMetamodel
in interfaceEntityPersister
- Returns:
- The metamodel
-
getEntityName
Description copied from interface:EntityPersister
The entity name which this persister maps.- Specified by:
getEntityName
in interfaceEntityMappingType
- Specified by:
getEntityName
in interfaceEntityPersister
- Returns:
- The name of the entity which this persister maps.
-
getPropertyType
Description copied from interface:EntityPersister
Get the type of a particular property by name.- Specified by:
getPropertyType
in interfaceEntityPersister
- Parameters:
propertyPath
- The name of the property for which to retrieve the type.- Returns:
- The type.
-
getIdentifierPropertyName
Override on subclasses!- Specified by:
getIdentifierPropertyName
in interfaceEntityPersister
-
identifierPropertyName
-
getIdentifierType
Override on subclasses!- Specified by:
getIdentifierType
in interfaceEntityPersister
-
identifierType
-
getVersionType
Override on subclasses!- Specified by:
getVersionType
in interfaceEntityPersister
- Returns:
- The type of the version property; or null, if not versioned.
-
versionType
-
getRootEntityName
Description copied from interface:EntityPersister
Returns an object that identifies the space in which identifiers of this entity hierarchy are unique. Might be a table name, a JNDI URL, etc.- Specified by:
getRootEntityName
in interfaceEntityPersister
- Returns:
- The root entity name.
-
getRootEntityPersister
-
getSubclassEntityNames
- Specified by:
getSubclassEntityNames
in interfaceEntityMappingType
-
toColumns
Description copied from interface:EntityPersister
Given a property path, return the corresponding column name(s).- Specified by:
toColumns
in interfaceEntityPersister
-
getPropertySpaces
Description copied from interface:EntityPersister
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only.For most implementations, this returns the complete set of table names to which instances of the mapped entity are persisted (not accounting for superclass entity mappings).
- Specified by:
getPropertySpaces
in interfaceEntityPersister
- Returns:
- The property spaces.
-
getQuerySpaces
Description copied from interface:EntityPersister
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class and its subclasses.Much like
EntityPersister.getPropertySpaces()
, except that here we include subclass entity spaces.- Specified by:
getQuerySpaces
in interfaceEntityPersister
- Returns:
- The query spaces.
-
getEntityPersister
Description copied from interface:EntityMappingType
Safety-net.- Specified by:
getEntityPersister
in interfaceEntityMappingType
-
getIdentifierColumnNames
Description copied from interface:EntityPersister
Get the names of columns used to persist the identifier- Specified by:
getIdentifierColumnNames
in interfaceEntityPersister
-
getTypeDiscriminatorMetadata
Description copied from interface:EntityPersister
Retrieve the information needed to properly deal with this entity's discriminator in a query.- Specified by:
getTypeDiscriminatorMetadata
in interfaceEntityPersister
- Returns:
- The entity discriminator metadata
-
getResolutionType
Description copied from interface:DiscriminatorMetadata
Get the type used to resolve the actual discriminator value.- Specified by:
getResolutionType
in interfaceDiscriminatorMetadata
- Returns:
- The resolution type.
-
getTableName
Description copied from interface:EntityPersister
The table to join to.- Specified by:
getTableName
in interfaceEntityPersister
-
toString
-
getVersionProperty
public int getVersionProperty()Description copied from interface:EntityPersister
IfEntityPersister.isVersioned()
, then what is the index of the property holding the locking value.- Specified by:
getVersionProperty
in interfaceEntityPersister
- Returns:
- The type of the version property; or -66, if not versioned.
-
isVersioned
public boolean isVersioned()Description copied from interface:EntityPersister
Determine whether optimistic locking by column is enabled for this entity.- Specified by:
isVersioned
in interfaceEntityPersister
- Returns:
- True if optimistic locking by column (i.e.,
<version/>
or<timestamp/>
) is enabled; false otherwise.
-
getMappedSuperclass
Description copied from interface:EntityMappingType
Get the name of the entity that is the "super class" for this entity- Specified by:
getMappedSuperclass
in interfaceEntityMappingType
- See Also:
-
getDiscriminatorType
Description copied from interface:EntityPersister
Get the discriminator type- Specified by:
getDiscriminatorType
in interfaceEntityPersister
-
isMutable
public boolean isMutable()Description copied from interface:EntityPersister
Determine whether instances of this entity are considered mutable.- Specified by:
isMutable
in interfaceEntityPersister
- Returns:
- True if the entity is considered mutable; false otherwise.
-