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 Concrete Methods Modifier and Type Method Description booleanconsumesEntityAlias()Very, very, very ugly...TypegetDiscriminatorType()Get the discriminator typeEntityMetamodelgetEntityMetamodel()Retrieve the underlying entity metamodel instance.StringgetEntityName()The entity name which this persister maps.EntityPersistergetEntityPersister()Safety-net.SessionFactoryImplementorgetFactory()Return theSessionFactoryto which this persister belongs.String[]getIdentifierColumnNames()Get the names of columns used to persist the identifierStringgetIdentifierPropertyName()Get the name of the identifier property (or return null) - need not return the name of an actual Java propertyTypegetIdentifierType()Get the identifier typeString[]getKeyColumnNames()The columns to join onStringgetMappedSuperclass()Get the name of the entity that is the "super class" for this entityStringgetName()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.TypegetPropertyType(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.TypegetResolutionType()Get the type used to resolve the actual discriminator value.StringgetRootEntityName()Returns an object that identifies the space in which identifiers of this entity hierarchy are unique.Set<String>getSubclassEntityNames()Queryable.DeclarergetSubclassPropertyDeclarer(String s)Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses...StringgetTableName()The table to join to.DiscriminatorMetadatagetTypeDiscriminatorMetadata()Retrieve the information needed to properly deal with this entity's discriminator in a query.intgetVersionProperty()IfEntityPersister.isVersioned(), then what is the index of the property holding the locking value.booleanisSubclassEntityName(String name)Determine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister.String[]toColumns(String propertyName)Given a property path, return the corresponding column name(s).StringtoString()TypetoType(String propertyName)Given a component path expression, get the type of the property-
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, getIdentifierTableDetails, getJavaType, getJdbcTypeCount, getMappedJavaType, getMappedTableDetails, getNaturalIdMapping, getNumberOfAttributeMappings, getNumberOfDeclaredAttributeMappings, getNumberOfFetchables, getPartMappingType, getPartName, getRootEntityDescriptor, getRootPathName, getRowIdMapping, getSoftDeleteMapping, getSoftDeleteTableDetails, getSubclassId, getSubMappingTypes, getSuperMappingType, getVersionMapping, hasWhereRestrictions, isAffectedByEnabledFetchProfiles, isAffectedByEnabledFilters, isAffectedByEntityGraph, isTypeOrSuperType, isTypeOrSuperType, optimisticLockStyle, pruneForSubclasses, pruneForSubclasses, 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, 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, getVersionType, hasCache, hasCascadeDelete, hasCascades, hasCollectionNotReferencingPK, hasCollections, hasIdentifierProperty, hasInsertGeneratedProperties, hasLazyProperties, hasMutableProperties, hasNaturalIdCache, hasNaturalIdentifier, hasOwnedCollections, hasProxy, hasSubselectLoadableCollections, hasUninitializedLazyProperties, hasUpdateGeneratedProperties, implementsLifecycle, initializeEnhancedEntityUsedAsProxy, insert, insert, instantiate, isBatchLoadable, isCacheInvalidationRequired, isIdentifierAssignedByInsert, isInherited, isInstance, isInstrumented, isLazyPropertiesCacheable, isMutable, isPropertySelectable, isSelectBeforeUpdateRequired, isTransient, isVersioned, 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.JdbcMappingContainer
getJdbcMapping, getSingleJdbcMapping
-
Methods inherited from interface org.hibernate.persister.entity.Joinable
consumesCollectionAlias, isCollection
-
Methods inherited from interface org.hibernate.loader.ast.spi.Loadable
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
-
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.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:EntityPersisterDetermine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister.- Specified by:
isSubclassEntityNamein 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:EntityPersisterReturn theSessionFactoryto which this persister belongs.- Specified by:
getFactoryin interfaceEntityPersister- Returns:
- The owning
SessionFactory.
-
getEntityMetamodel
public EntityMetamodel getEntityMetamodel()
Description copied from interface:EntityPersisterRetrieve the underlying entity metamodel instance.- Specified by:
getEntityMetamodelin interfaceEntityPersister- Returns:
- The metamodel
-
getEntityName
public String getEntityName()
Description copied from interface:EntityPersisterThe entity name which this persister maps.- Specified by:
getEntityNamein interfaceEntityMappingType- Specified by:
getEntityNamein interfaceEntityPersister- Returns:
- The name of the entity which this persister maps.
-
getName
public String getName()
Description copied from interface:JoinableAn identifying name; a class name or collection role name.
-
getPropertyType
public final Type getPropertyType(String propertyPath)
Description copied from interface:EntityPersisterGet the type of a particular property by name.- Specified by:
getPropertyTypein interfaceEntityPersister- Parameters:
propertyPath- The name of the property for which to retrieve the type.- Returns:
- The type.
-
getIdentifierType
public Type getIdentifierType()
Description copied from interface:EntityPersisterGet the identifier type- Specified by:
getIdentifierTypein interfaceEntityPersister
-
getIdentifierPropertyName
public String getIdentifierPropertyName()
Description copied from interface:EntityPersisterGet the name of the identifier property (or return null) - need not return the name of an actual Java property- Specified by:
getIdentifierPropertyNamein interfaceEntityPersister
-
toType
public Type toType(String propertyName) throws QueryException
Description copied from interface:PropertyMappingGiven a component path expression, get the type of the property- Specified by:
toTypein interfacePropertyMapping- Throws:
QueryException
-
getRootEntityName
public String getRootEntityName()
Description copied from interface:EntityPersisterReturns 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:
getRootEntityNamein interfaceEntityPersister- Returns:
- The root entity name.
-
getSubclassEntityNames
public Set<String> getSubclassEntityNames()
- Specified by:
getSubclassEntityNamesin interfaceEntityMappingType
-
getSubclassPropertyDeclarer
public Queryable.Declarer getSubclassPropertyDeclarer(String s)
Description copied from interface:QueryableDetermine 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:
getSubclassPropertyDeclarerin interfaceQueryable- Parameters:
s- The property name.- Returns:
- The property declarer
-
toColumns
public String[] toColumns(String propertyName)
Description copied from interface:PropertyMappingGiven a property path, return the corresponding column name(s).- Specified by:
toColumnsin interfacePropertyMapping
-
getPropertySpaces
public String[] getPropertySpaces()
Description copied from interface:EntityPersisterReturns 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:
getPropertySpacesin interfaceEntityPersister- Returns:
- The property spaces.
-
getQuerySpaces
public Serializable[] getQuerySpaces()
Description copied from interface:EntityPersisterReturns 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:
getQuerySpacesin interfaceEntityPersister- Returns:
- The query spaces.
-
getEntityPersister
public EntityPersister getEntityPersister()
Description copied from interface:EntityMappingTypeSafety-net.- Specified by:
getEntityPersisterin interfaceEntityMappingType
-
getKeyColumnNames
public String[] getKeyColumnNames()
Description copied from interface:JoinableThe columns to join on- Specified by:
getKeyColumnNamesin interfaceJoinable
-
getIdentifierColumnNames
public String[] getIdentifierColumnNames()
Description copied from interface:QueryableGet the names of columns used to persist the identifier- Specified by:
getIdentifierColumnNamesin interfaceEntityPersister- Specified by:
getIdentifierColumnNamesin interfaceLoadable- Specified by:
getIdentifierColumnNamesin interfaceQueryable
-
getTypeDiscriminatorMetadata
public DiscriminatorMetadata getTypeDiscriminatorMetadata()
Description copied from interface:QueryableRetrieve the information needed to properly deal with this entity's discriminator in a query.- Specified by:
getTypeDiscriminatorMetadatain interfaceQueryable- Returns:
- The entity discriminator metadata
-
getResolutionType
public Type getResolutionType()
Description copied from interface:DiscriminatorMetadataGet the type used to resolve the actual discriminator value.- Specified by:
getResolutionTypein interfaceDiscriminatorMetadata- Returns:
- The resolution type.
-
getTableName
public String getTableName()
Description copied from interface:JoinableThe table to join to.- Specified by:
getTableNamein interfaceJoinable
-
getVersionProperty
public int getVersionProperty()
Description copied from interface:EntityPersisterIfEntityPersister.isVersioned(), then what is the index of the property holding the locking value.- Specified by:
getVersionPropertyin interfaceEntityPersister- Returns:
- The type of the version property; or -66, if not versioned.
-
getMappedSuperclass
public String getMappedSuperclass()
Description copied from interface:EntityMappingTypeGet the name of the entity that is the "super class" for this entity- Specified by:
getMappedSuperclassin interfaceEntityMappingType- Specified by:
getMappedSuperclassin interfaceQueryable- See Also:
EntityMappingType.getSuperMappingType()
-
consumesEntityAlias
public boolean consumesEntityAlias()
Description copied from interface:JoinableVery, very, very ugly...- Specified by:
consumesEntityAliasin interfaceJoinable- Returns:
- Does this persister "consume" entity column aliases in the result set?
-
getDiscriminatorType
public Type getDiscriminatorType()
Description copied from interface:LoadableGet the discriminator type- Specified by:
getDiscriminatorTypein interfaceLoadable
-
-