Top Description Inners Fields Constructors Methods
org.hibernate.boot.model.internal

public Class EntityBinder

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, java.util.ArrayList, .Collections, .HashMap, .HashSet, .Iterator, .List, .Locale, .Map, .Set, org.hibernate.AnnotationException, .AssertionFailure, .MappingException, org.hibernate.annotations.BatchSize, .Cache, .CacheConcurrencyStrategy, .Check, .Checks, .DiscriminatorFormula, .DiscriminatorOptions, .DynamicInsert, .DynamicUpdate, .Filter, .Filters, .HQLSelect, .Immutable, .Loader, .Mutability, .NaturalIdCache, .OnDelete, .OptimisticLockType, .OptimisticLocking, .Persister, .Polymorphism, .PolymorphismType, .Proxy, .RowId, .SQLDelete, .SQLDeleteAll, .SQLDeletes, .SQLInsert, .SQLInserts, .SQLRestriction, .SQLSelect, .SQLUpdate, .SQLUpdates, .SecondaryRow, .SecondaryRows, .SelectBeforeUpdate, .SoftDelete, .Subselect, .Synchronize, .Tables, .TypeBinderType, .View, .Where, org.hibernate.annotations.common.reflection.ReflectionManager, .XAnnotatedElement, .XClass, .XProperty, org.hibernate.binder.TypeBinder, org.hibernate.boot.model.IdentifierGeneratorDefinition, .NamedEntityGraphDefinition, org.hibernate.boot.model.internal.InheritanceState.ElementsToProcess, org.hibernate.boot.model.naming.EntityNaming, .Identifier, .ImplicitEntityNameSource, .NamingStrategyHelper, org.hibernate.boot.model.relational.QualifiedTableName, org.hibernate.boot.spi.AccessType, .InFlightMetadataCollector, .MetadataBuildingContext, .PropertyData, org.hibernate.cfg.AvailableSettings, org.hibernate.engine.OptimisticLockStyle, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment, org.hibernate.engine.spi.FilterDefinition, org.hibernate.internal.CoreMessageLogger, org.hibernate.jpa.event.spi.CallbackType, org.hibernate.mapping.BasicValue, .CheckConstraint, .Component, .DependantValue, .Join, .JoinedSubclass, .MappedSuperclass, .PersistentClass, .Property, .RootClass, .SimpleValue, .SingleTableSubclass, .Subclass, .Table, .TableOwner, .UnionSubclass, .Value, org.hibernate.persister.entity.EntityPersister, org.hibernate.spi.NavigablePath, org.jboss.logging.Logger, jakarta.persistence.Access, .AttributeOverride, .AttributeOverrides, .Cacheable, .ConstraintMode, .DiscriminatorColumn, .DiscriminatorValue, .Entity, .ForeignKey, .GeneratedValue, .IdClass, .Inheritance, .InheritanceType, .JoinColumn, .JoinTable, .NamedEntityGraph, .NamedEntityGraphs, .PrimaryKeyJoinColumn, .PrimaryKeyJoinColumns, .SecondaryTable, .SecondaryTables, .SharedCacheMode, .UniqueConstraint

Stateful binder responsible for interpreting information about an Entity class and producing a PersistentClass mapping model object.
Author
Emmanuel Bernard

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private XClass
private String
private boolean
private String
private MetadataBuildingContext
private final List<Filter>
private Boolean
private boolean
private Boolean
private boolean
private boolean
private static final CoreMessageLogger
private String
private static final String
private String
private PersistentClass
private PolymorphismType
polymorphismType

Deprecated as a consequence of PolymorphismType being deprecated.
private AccessType
private XClass
private final Map<String, Object>
private final Map<String, Object>
private final Map<String, Join>
private final Map<String, Join>
private String
private String
private boolean

Constructor Summary

AccessConstructor and Description
public
EntityBinder()

Use as a fake one for Collection of elements

public
EntityBinder(XClass annotatedClass, PersistentClass persistentClass, MetadataBuildingContext context)

Method Summary

Modifier and TypeMethod and Description
private void
addCheckToEntity(Check check)

For now, we store it on the entity.

public void
addFilter(Filter filter)

public Join
addJoin(JoinTable joinTable, PropertyHolder holder, boolean noDelayInPkColumnCreation)

public Join
addJoin(SecondaryTable secondaryTable, PropertyHolder holder, boolean noDelayInPkColumnCreation)

private Join
addJoin(PropertyHolder propertyHolder, boolean noDelayInPkColumnCreation, boolean secondaryTable, String name, String schema, String catalog, Object joinColumns, UniqueConstraint[] uniqueConstraints)

public void
private void
private static void
bindCallbacks(XClass entityClass, PersistentClass persistentClass, MetadataBuildingContext context)

private void
private void
private void
public void
public void
private void
public static void
bindEntityClass(XClass clazzToProcess, Map<XClass, InheritanceState> inheritanceStates, Map<String, IdentifierGeneratorDefinition> generators, MetadataBuildingContext context)

Bind an entity class.

private void
private void
public void
bindFiltersInHierarchy()

Process the filters defined on the given class, as well as all filters defined on the MappedSuperclass(es) in the inheritance hierarchy

private void
bindIdClass(PropertyData inferredData, PropertyData baseInferredData, PropertyHolder propertyHolder, AccessType propertyAccessor, MetadataBuildingContext buildingContext, Map<XClass, InheritanceState> inheritanceStates)

private void
private void
private void
private void
public void
private void
private void
private void
private static void
bindSoftDelete(XClass xClass, RootClass rootClass, InheritanceState inheritanceState, MetadataBuildingContext context)

private void
private void
public void
bindTable(String schema, String catalog, String tableName, UniqueConstraint[] uniqueConstraints, String rowId, String viewQuery, InFlightMetadataCollector.EntityTableXref denormalizedSuperTableXref)

public void
public void
private static Cache
private void
private static void
checkNoJoinColumns(XClass clazzToProcess)

private AnnotatedJoinColumns
pack-priv Join
createJoin(PropertyHolder propertyHolder, boolean noDelayInPkColumnCreation, boolean secondaryTable, Object joinColumns, QualifiedTableName logicalName, Table table)

private AnnotatedJoinColumns
createJoinColumns(PropertyHolder propertyHolder, PrimaryKeyJoinColumn[] primaryKeyJoinColumns, JoinColumn[] joinColumns)

private Component
createMapper(Map<XClass, InheritanceState> inheritanceStates, PersistentClass persistentClass, PropertyHolder propertyHolder, MetadataBuildingContext context, XClass classWithIdClass, XClass compositeClass, PropertyData baseInferredData, AccessType propertyAccessor, boolean isIdClass)

private Component
createMapperProperty(Map<XClass, InheritanceState> inheritanceStates, PersistentClass persistentClass, PropertyHolder propertyHolder, MetadataBuildingContext context, XClass classWithIdClass, XClass compositeClass, PropertyData baseInferredData, AccessType propertyAccessor, boolean isIdClass)

private void
private void
createTable(InheritanceState inheritanceState, PersistentClass superEntity, String schema, String table, String catalog, UniqueConstraint[] uniqueConstraints, InFlightMetadataCollector collector)

Deprecated as a consequence of InFlightMetadataCollector being deprecated.
private static void
private static CacheConcurrencyStrategy
private void
private static SoftDelete
extractSoftDelete(XClass xClass, RootClass rootClass, InheritanceState inheritanceState, MetadataBuildingContext context)

public void
public void
private Table
findMatchingComplementaryTableAnnotation(String tableName)

Deprecated as a consequence of Table being deprecated.
private SecondaryRow
private SecondaryTable
private <T extends Annotation, R extends Annotation> T
findMatchingSqlAnnotation(String tableName, Class<T> annotationType, Class<R> repeatableType)

private Table
findTable(String tableName)

public static String
private String
public AccessType
private static String
public PersistentClass
public AccessType
public AccessType
public Map<String, Join>
private static PersistentClass
getSuperEntity(XClass clazzToProcess, Map<XClass, InheritanceState> inheritanceStates, MetadataBuildingContext context, InheritanceState inheritanceState)

private static PropertyData
getUniqueIdPropertyFromBaseClass(PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, MetadataBuildingContext context)

private OptimisticLockStyle
private void
private void
handleClassTable(InheritanceState inheritanceState, PersistentClass superEntity)

private static void
private Set<String>
handleIdClass(PersistentClass persistentClass, InheritanceState inheritanceState, MetadataBuildingContext context, PropertyHolder propertyHolder, InheritanceState.ElementsToProcess elementsToProcess, Map<XClass, InheritanceState> inheritanceStates)

private void
handleIdentifier(PropertyHolder propertyHolder, Map<XClass, InheritanceState> inheritanceStates, Map<String, IdentifierGeneratorDefinition> generators, InheritanceState inheritanceState)

private static void
private void
handleInheritance(InheritanceState inheritanceState, PersistentClass superEntity, PropertyHolder propertyHolder)

private void
private void
private static boolean
isCacheable(SharedCacheMode sharedCacheMode, Cacheable explicitCacheableAnn)

private static boolean
isCacheLazy(Cache effectiveCache, XClass annotatedClass)

private boolean
isExplicitPolymorphism(PolymorphismType type)

Deprecated as a consequence of PolymorphismType being deprecated.
private boolean
private static boolean
isIdClassPkOfTheAssociatedEntity(InheritanceState.ElementsToProcess elementsToProcess, XClass compositeClass, PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, Map<XClass, InheritanceState> inheritanceStates, MetadataBuildingContext context)

public boolean
private boolean
public boolean

Returns:

true if a property by that given name does already exist in the super hierarchy.
isPropertyDefinedInSuperHierarchy
(String
The name of the property to check
name
)

Delegates to PersistentClass#isPropertyDefinedInHierarchy, after verifying that there is a PersistentClass available.

public boolean
private void
private static PersistentClass
makePersistentClass(InheritanceState inheritanceState, PersistentClass superEntity, MetadataBuildingContext metadataBuildingContext)

private boolean
mapAsIdClass(Map<XClass, InheritanceState> inheritanceStates, InheritanceState inheritanceState, PersistentClass persistentClass, PropertyHolder propertyHolder, InheritanceState.ElementsToProcess elementsToProcess, Set<String> idPropertiesIfIdClass, MetadataBuildingContext context)

private void
public void
public void
processComplementaryTableDefinitions(Table table)

Deprecated as a consequence of Table being deprecated.
public void
processComplementaryTableDefinitions(Tables tables)

Deprecated as a consequence of Tables being deprecated.
private void
private void
processIdPropertiesIfNotAlready(PersistentClass persistentClass, InheritanceState inheritanceState, MetadataBuildingContext context, PropertyHolder propertyHolder, Map<String, IdentifierGeneratorDefinition> generators, Set<String> idPropertiesIfIdClass, InheritanceState.ElementsToProcess elementsToProcess, Map<XClass, InheritanceState> inheritanceStates)

private AnnotatedDiscriminatorColumn
processJoinedDiscriminatorProperties(InheritanceState inheritanceState)

Process all discriminator-related metadata per rules for "joined" inheritance, taking into account hibernate.discriminator.implicit_for_joined and hibernate.discriminator.ignore_explicit_for_joined.

private void
private void
private void
private AnnotatedDiscriminatorColumn
processSingleTableDiscriminatorProperties(InheritanceState inheritanceState)

Process all discriminator-related metadata per rules for "single table" inheritance

private XClass
proxyClass(Proxy proxy)

Deprecated as a consequence of Proxy being deprecated.
private void
private static String
private void
public void
setIgnoreIdAnnotations(boolean ignoreIdAnnotations)

public void
setPropertyAccessType(AccessType propertyAccessType)

public void
setWrapIdsInEmbeddedComponents(boolean wrapIdsInEmbeddedComponents)

private void
private static AnnotatedJoinColumns
subclassJoinColumns(XClass clazzToProcess, PersistentClass superEntity, MetadataBuildingContext context)

private static <T extends Annotation> String
tableMember(Class<T> annotationType, T sqlAnnotation)

private String
toPhysicalName(JdbcEnvironment jdbcEnvironment, String logicalName)

private boolean
useDiscriminatorColumnForJoined(DiscriminatorColumn discriminatorColumn)

We want to process the discriminator column if either:

  1. there is an explicit DiscriminatorColumn annotation and we are not told to ignore it via hibernate.discriminator.ignore_explicit_for_joined, or
  2. there is no explicit DiscriminatorColumn annotation but we are told to create it implicitly via hibernate.discriminator.implicit_for_joined.
private static <T extends Annotation> Annotation[]
valueMember(Class<T> repeatableType, T sqlAnnotation)

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait