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
,Loadable
,EntityMutationTarget
,PropertyMapping
,Queryable
,AttributeSource
,RootTableGroupProducer
,TableGroupProducer
,MutationTarget<EntityTableMapping>
,FetchableContainer
- Direct Known Subclasses:
ProcessorSessionFactory.EntityPersister
public abstract class MockEntityPersister extends Object implements EntityPersister, Queryable, 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
-
Nested classes/interfaces inherited from interface org.hibernate.persister.entity.Queryable
Queryable.Declarer
-
-
Field Summary
-
Fields inherited from interface org.hibernate.persister.entity.EntityPersister
ENTITY_ID
-
Fields inherited from interface org.hibernate.persister.entity.Loadable
ROWID_ALIAS
-
-
Constructor Summary
Constructors Constructor Description MockEntityPersister(String entityName, AccessType defaultAccessType, MockSessionFactory factory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
consumesEntityAlias()
Very, very, very ugly...Type
getDiscriminatorType()
Get the discriminator typeEntityMetamodel
getEntityMetamodel()
Retrieve the underlying entity metamodel instance.String
getEntityName()
The entity name which this persister maps.EntityPersister
getEntityPersister()
Safety-net.SessionFactoryImplementor
getFactory()
Return theSessionFactory
to which this persister belongs.String[]
getIdentifierColumnNames()
Get the names of columns used to persist the identifierString
getIdentifierPropertyName()
Override on subclasses!Type
getIdentifierType()
Override on subclasses!String[]
getKeyColumnNames()
The columns to join onString
getMappedSuperclass()
Get the name of the entity that is the "super class" for this entityString
getName()
An identifying name; a class name or collection role name.String[]
getPropertySpaces()
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class only.Type
getPropertyType(String propertyPath)
Get the type of a particular property by name.Serializable[]
getQuerySpaces()
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class and its subclasses.Type
getResolutionType()
Get the type used to resolve the actual discriminator value.abstract String
getRootEntityName()
Returns an object that identifies the space in which identifiers of this entity hierarchy are unique.MockEntityPersister
getRootEntityPersister()
Set<String>
getSubclassEntityNames()
Queryable.Declarer
getSubclassPropertyDeclarer(String s)
Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...String
getTableName()
The table to join to.DiscriminatorMetadata
getTypeDiscriminatorMetadata()
Retrieve the information needed to properly deal with this entity's discriminator in a query.int
getVersionProperty()
IfEntityPersister.isVersioned()
, then what is the index of the property holding the locking value.BasicType<?>
getVersionType()
Override on subclasses!protected abstract String
identifierPropertyName()
protected abstract Type
identifierType()
boolean
isMutable()
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
isVersioned()
Determine whether optimistic locking by column is enabled for this entity.String[]
toColumns(String propertyName)
Given a property path, return the corresponding column name(s).String
toString()
Type
toType(String propertyName)
Given a component path expression, get the type of the propertyprotected abstract BasicType<?>
versionType()
-
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, getFetchable, getIdentifierMapping, getIdentifierMappingForJoin, getIdentifierTableDetails, getJavaType, getJdbcTypeCount, getMappedJavaType, getMappedTableDetails, getNaturalIdMapping, getNumberOfAttributeMappings, getNumberOfDeclaredAttributeMappings, getNumberOfFetchables, getPartMappingType, getPartName, getRootEntityDescriptor, getRootPathName, getRowIdMapping, getSoftDeleteMapping, getSoftDeleteTableDetails, getSubclassId, getSubMappingTypes, getSuperMappingType, getVersionMapping, hasWhereRestrictions, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEntityGraph, isConcreteProxy, isTypeOrSuperType, isTypeOrSuperType, optimisticLockStyle, pruneForSubclasses, pruneForSubclasses, resolveConcreteProxyTypeForId, visitAttributeMappings, visitConstraintOrderedTables, visitDeclaredAttributeMappings, visitSubTypeAttributeMappings, visitSuperTypeAttributeMappings
-
Methods inherited from interface org.hibernate.persister.entity.mutation.EntityMutationTarget
getIdentifierDescriptor, getIdentifierTableMapping, getIdentityInsertDelegate, getInsertDelegate, getMutationDelegate, getTargetPart, getUpdateDelegate, hasSkippableTables
-
Methods inherited from interface org.hibernate.persister.entity.EntityPersister
addToCacheKey, afterInitialize, afterReassociate, breakDownJdbcValues, buildCacheEntry, canExtractIdOutOfEntity, canReadFromCache, canUseReferenceCacheEntries, canWriteToCache, createProxy, delete, findDirty, findModified, forceVersionIncrement, forceVersionIncrement, getAttributeMapping, getBatchSize, getBytecodeEnhancementMetadata, getCacheAccessStrategy, getCacheEntryStructure, getClassMetadata, getConcreteProxyClass, getCurrentVersion, getDatabaseSnapshot, getDeleteCoordinator, getEntityEntryFactory, getEntityMappingType, getFilterAliasGenerator, getFilterAliasGenerator, getGeneratedProperties, getGenerator, getIdByUniqueKey, getIdentifier, getIdentifier, getIdentifierGenerator, getIdentitySelectString, getInsertCoordinator, getInsertGeneratedProperties, getInstrumentationMetadata, getMappedClass, getMergeCoordinator, getMultiNaturalIdLoader, getNaturalIdCacheAccessStrategy, getNaturalIdentifierProperties, getNaturalIdentifierSnapshot, getNaturalIdLoader, getPropertyCascadeStyles, getPropertyCheckability, getPropertyInsertability, getPropertyLaziness, getPropertyNames, getPropertyNullability, getPropertyTypes, getPropertyUpdateability, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesToInsert, getPropertyVersionability, getRepresentationStrategy, getRootTableKeyColumnNames, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSelectByUniqueKeyString, getSqlAliasStem, getSqmMultiTableInsertStrategy, getSqmMultiTableMutationStrategy, getSubclassEntityPersister, getSynchronizationSpaces, getSynchronizedQuerySpaces, getUpdateCoordinator, getUpdateGeneratedProperties, getValue, getValues, getVersion, getVersionGenerator, getVersionJavaType, hasCache, hasCascadeDelete, hasCascades, hasCollectionNotReferencingPK, hasCollections, hasFilterForLoadByKey, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyProperties, hasMutableProperties, hasNaturalIdCache, hasNaturalIdentifier, hasOwnedCollections, hasProxy, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, implementsLifecycle, initializeEnhancedEntityUsedAsProxy, insert, insert, instantiate, isBatchLoadable, isCacheInvalidationRequired, isIdentifierAssignedByInsert, isInherited, isInstance, isInstrumented, isLazyPropertiesCacheable, isPropertySelectable, isSelectBeforeUpdateRequired, isTransient, isVersionPropertyGenerated, load, load, load, load, loadByUniqueKey, loadEntityIdByNaturalId, lock, lock, merge, multiLoad, postInstantiate, prepareLoaders, processInsertGeneratedProperties, processInsertGeneratedProperties, processUpdateGeneratedProperties, processUpdateGeneratedProperties, resetIdentifier, resolveAttributeIndexes, resolveDirtyAttributeIndexes, 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.persister.entity.Joinable
consumesCollectionAlias, isCollection
-
Methods inherited from interface org.hibernate.loader.ast.spi.Loadable
isAffectedByEnabledFilters, isAffectedByInfluencers, isAffectedByInfluencers, isNotAffectedByInfluencers
-
Methods inherited from interface org.hibernate.persister.entity.Loadable
getDiscriminatorAlias, getDiscriminatorColumnName, getDiscriminatorValue, getIdentifierAliases, getPropertyAliases, getPropertyColumnNames, getSubclassForDiscriminatorValue, getTableAliasForColumn, hasRowId, hasSubclasses, registerAffectingFetchProfile
-
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.persister.entity.Queryable
generateFilterConditionAlias, getConstraintOrderedTableNameClosure, getContraintOrderedTableKeyColumnClosure, getDiscriminatorSQLValue, getSubclassPropertyFormulaTemplateClosure, getSubclassPropertyTableNumber, getSubclassTableName, isAbstract, isExplicitPolymorphism, isMultiTable, isVersionPropertyInsertable
-
Methods inherited from interface org.hibernate.metamodel.mapping.Restrictable
applyBaseRestrictions
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference
-
-
-
-
Constructor Detail
-
MockEntityPersister
public MockEntityPersister(String entityName, AccessType defaultAccessType, MockSessionFactory factory)
-
-
Method Detail
-
isSubclassEntityName
public boolean isSubclassEntityName(String name)
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
public SessionFactoryImplementor getFactory()
Description copied from interface:EntityPersister
Return theSessionFactory
to which this persister belongs.- Specified by:
getFactory
in interfaceEntityPersister
- Returns:
- The owning
SessionFactory
.
-
getEntityMetamodel
public EntityMetamodel getEntityMetamodel()
Description copied from interface:EntityPersister
Retrieve the underlying entity metamodel instance.- Specified by:
getEntityMetamodel
in interfaceEntityPersister
- Returns:
- The metamodel
-
getEntityName
public String 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.
-
getName
public String getName()
Description copied from interface:Joinable
An identifying name; a class name or collection role name.
-
getPropertyType
public final Type getPropertyType(String propertyPath)
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
public String getIdentifierPropertyName()
Override on subclasses!- Specified by:
getIdentifierPropertyName
in interfaceEntityPersister
-
identifierPropertyName
protected abstract String identifierPropertyName()
-
getIdentifierType
public Type getIdentifierType()
Override on subclasses!- Specified by:
getIdentifierType
in interfaceEntityPersister
-
identifierType
protected abstract Type identifierType()
-
getVersionType
public BasicType<?> getVersionType()
Override on subclasses!- Specified by:
getVersionType
in interfaceEntityPersister
- Returns:
- The type of the version property; or null, if not versioned.
-
versionType
protected abstract BasicType<?> versionType()
-
toType
public Type toType(String propertyName) throws QueryException
Description copied from interface:PropertyMapping
Given a component path expression, get the type of the property- Specified by:
toType
in interfacePropertyMapping
- Throws:
QueryException
-
getRootEntityName
public abstract String 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
public MockEntityPersister getRootEntityPersister()
-
getSubclassEntityNames
public Set<String> getSubclassEntityNames()
- Specified by:
getSubclassEntityNames
in interfaceEntityMappingType
-
getSubclassPropertyDeclarer
public Queryable.Declarer getSubclassPropertyDeclarer(String s)
Description copied from interface:Queryable
Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...Note: the method is called 'subclass property...' simply for consistency sake (e.g.
Queryable.getSubclassPropertyTableNumber(java.lang.String)
- Specified by:
getSubclassPropertyDeclarer
in interfaceQueryable
- Parameters:
s
- The property name.- Returns:
- The property declarer
-
toColumns
public String[] toColumns(String propertyName)
Description copied from interface:PropertyMapping
Given a property path, return the corresponding column name(s).- Specified by:
toColumns
in interfacePropertyMapping
-
getPropertySpaces
public String[] 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
public Serializable[] 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
public EntityPersister getEntityPersister()
Description copied from interface:EntityMappingType
Safety-net.- Specified by:
getEntityPersister
in interfaceEntityMappingType
-
getKeyColumnNames
public String[] getKeyColumnNames()
Description copied from interface:Joinable
The columns to join on- Specified by:
getKeyColumnNames
in interfaceJoinable
-
getIdentifierColumnNames
public String[] getIdentifierColumnNames()
Description copied from interface:Queryable
Get the names of columns used to persist the identifier- Specified by:
getIdentifierColumnNames
in interfaceEntityPersister
- Specified by:
getIdentifierColumnNames
in interfaceLoadable
- Specified by:
getIdentifierColumnNames
in interfaceQueryable
-
getTypeDiscriminatorMetadata
public DiscriminatorMetadata getTypeDiscriminatorMetadata()
Description copied from interface:Queryable
Retrieve the information needed to properly deal with this entity's discriminator in a query.- Specified by:
getTypeDiscriminatorMetadata
in interfaceQueryable
- Returns:
- The entity discriminator metadata
-
getResolutionType
public Type 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
public String getTableName()
Description copied from interface:Joinable
The table to join to.- Specified by:
getTableName
in interfaceJoinable
-
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
public String 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
- Specified by:
getMappedSuperclass
in interfaceQueryable
- See Also:
EntityMappingType.getSuperMappingType()
-
consumesEntityAlias
public boolean consumesEntityAlias()
Description copied from interface:Joinable
Very, very, very ugly...- Specified by:
consumesEntityAlias
in interfaceJoinable
- Returns:
- Does this persister "consume" entity column aliases in the result set?
-
getDiscriminatorType
public Type getDiscriminatorType()
Description copied from interface:Loadable
Get the discriminator type- Specified by:
getDiscriminatorType
in interfaceLoadable
-
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.
-
-