Class CollectionBinder
java.lang.Object
org.hibernate.boot.model.internal.CollectionBinder
- Direct Known Subclasses:
BagBinder
,ListBinder
,MapBinder
,SetBinder
Base class for stateful binders responsible for producing mapping model objects of type
Collection
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collection
protected org.hibernate.models.spi.ClassDetails
protected AnnotatedJoinColumns
protected boolean
protected IndexColumn
protected Map<org.hibernate.models.spi.ClassDetails,
InheritanceState> protected AnnotatedJoinColumns
protected boolean
protected Map<String,
IdentifierGeneratorDefinition> protected AnnotatedColumns
protected AnnotatedJoinColumns
protected String
protected NotFoundAction
protected OnDeleteAction
protected org.hibernate.models.spi.MemberDetails
protected PropertyHolder
protected String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CollectionBinder
(Supplier<ManagedBean<? extends UserCollectionType>> customTypeBeanResolver, boolean isSortedCollection, MetadataBuildingContext buildingContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
adjustUserSuppliedValueCollectionOrderingFragment
(String orderByFragment) void
bind()
static void
bindCollection
(PropertyHolder propertyHolder, Nullability nullability, PropertyData inferredData, EntityBinder entityBinder, boolean isIdentifierMapper, MetadataBuildingContext context, Map<org.hibernate.models.spi.ClassDetails, InheritanceState> inheritanceStatePerClass, org.hibernate.models.spi.MemberDetails property, AnnotatedJoinColumns joinColumns) The first pass at binding a collection.void
bindManyToManyInverseForeignKey
(PersistentClass targetEntity, AnnotatedJoinColumns joinColumns, SimpleValue value, boolean unique) Bind the inverse foreign key of aManyToMany
, that is, the columns specified by@JoinTable(inverseJoinColumns=...)
, which are the columns that reference the target entity of the many-to-many association.protected void
bindOneToManySecondPass
(Map<String, PersistentClass> persistentClasses) Bind aOneToMany
association.protected boolean
bindStarToManySecondPass
(Map<String, PersistentClass> persistentClasses) return true if it's a Fk, false if it's an association tableprotected abstract Collection
createCollection
(PersistentClass persistentClass) protected MetadataBuildingContext
static CollectionBinder
getCollectionBinder
(org.hibernate.models.spi.MemberDetails property, boolean isHibernateExtensionMapping, MetadataBuildingContext buildingContext) collection binder factorySupplier<ManagedBean<? extends UserCollectionType>>
protected boolean
boolean
isMap()
protected boolean
mappingDefinedAttributeOverrideOnElement
(org.hibernate.models.spi.MemberDetails property) static ManagedBean<? extends UserCollectionType>
resolveCustomType
(org.hibernate.models.spi.MemberDetails property, CollectionType typeAnnotation, MetadataBuildingContext context) void
setAccessType
(AccessType accessType) void
void
setCascadeStrategy
(String cascadeStrategy) void
setComparatorSort
(SortComparator comparatorSort) void
setDeclaringClass
(org.hibernate.models.spi.ClassDetails declaringClass) void
setElementColumns
(AnnotatedColumns elementColumns) void
setElementType
(org.hibernate.models.spi.TypeDetails collectionElementType) void
setEmbedded
(boolean annotationPresent) void
setExplicitAssociationTable
(boolean isExplicitAssociationTable) void
setFkJoinColumns
(AnnotatedJoinColumns annotatedJoinColumns) void
setIndexColumn
(IndexColumn indexColumn) void
setInheritanceStatePerClass
(Map<org.hibernate.models.spi.ClassDetails, InheritanceState> inheritanceStatePerClass) void
setInsertable
(boolean insertable) void
setInverseJoinColumns
(AnnotatedJoinColumns inverseJoinColumns) protected void
setIsHibernateExtensionMapping
(boolean hibernateExtensionMapping) void
setJoinColumns
(AnnotatedJoinColumns joinColumns) void
setJpaOrderBy
(OrderBy jpaOrderBy) void
setLocalGenerators
(Map<String, IdentifierGeneratorDefinition> localGenerators) void
void
setMapKeyColumns
(AnnotatedColumns mapKeyColumns) void
setMapKeyManyToManyColumns
(AnnotatedJoinColumns mapJoinColumns) void
setMappedBy
(String mappedBy) void
setNaturalSort
(SortNatural naturalSort) void
setNotFoundAction
(NotFoundAction notFoundAction) void
setOnDeleteActionAction
(OnDeleteAction onDeleteAction) void
setOneToMany
(boolean oneToMany) void
setProperty
(org.hibernate.models.spi.MemberDetails property) void
setPropertyHolder
(PropertyHolder propertyHolder) void
setPropertyName
(String propertyName) void
setQueryCacheLayout
(QueryCacheLayout queryCacheLayout) void
setSqlOrder
(SQLOrder sqlOrder) void
setTableBinder
(TableBinder tableBinder) void
setTargetEntity
(Class<?> targetEntity) void
setTargetEntity
(org.hibernate.models.spi.ClassDetails targetEntity) void
setTargetEntity
(org.hibernate.models.spi.TypeDetails targetEntity) void
setUpdatable
(boolean updatable)
-
Field Details
-
collection
-
propertyName
-
propertyHolder
-
declaringClass
protected org.hibernate.models.spi.ClassDetails declaringClass -
property
protected org.hibernate.models.spi.MemberDetails property -
indexColumn
-
onDeleteAction
-
hasMapKeyProperty
protected boolean hasMapKeyProperty -
mapKeyPropertyName
-
inverseJoinColumns
-
foreignJoinColumns
-
isEmbedded
protected boolean isEmbedded -
notFoundAction
-
mapKeyColumns
-
mapKeyManyToManyColumns
-
localGenerators
-
inheritanceStatePerClass
-
-
Constructor Details
-
CollectionBinder
protected CollectionBinder(Supplier<ManagedBean<? extends UserCollectionType>> customTypeBeanResolver, boolean isSortedCollection, MetadataBuildingContext buildingContext)
-
-
Method Details
-
bindCollection
public static void bindCollection(PropertyHolder propertyHolder, Nullability nullability, PropertyData inferredData, EntityBinder entityBinder, boolean isIdentifierMapper, MetadataBuildingContext context, Map<org.hibernate.models.spi.ClassDetails, InheritanceState> inheritanceStatePerClass, org.hibernate.models.spi.MemberDetails property, AnnotatedJoinColumns joinColumns) The first pass at binding a collection. -
getBuildingContext
-
getCustomTypeBeanResolver
-
isMap
public boolean isMap() -
setIsHibernateExtensionMapping
protected void setIsHibernateExtensionMapping(boolean hibernateExtensionMapping) -
isHibernateExtensionMapping
protected boolean isHibernateExtensionMapping() -
setUpdatable
public void setUpdatable(boolean updatable) -
setInheritanceStatePerClass
public void setInheritanceStatePerClass(Map<org.hibernate.models.spi.ClassDetails, InheritanceState> inheritanceStatePerClass) -
setInsertable
public void setInsertable(boolean insertable) -
setCascadeStrategy
-
setAccessType
-
setInverseJoinColumns
-
setJoinColumns
-
setPropertyHolder
-
setJpaOrderBy
-
setSqlOrder
-
setNaturalSort
-
setComparatorSort
-
getCollectionBinder
public static CollectionBinder getCollectionBinder(org.hibernate.models.spi.MemberDetails property, boolean isHibernateExtensionMapping, MetadataBuildingContext buildingContext) collection binder factory -
resolveCustomType
public static ManagedBean<? extends UserCollectionType> resolveCustomType(org.hibernate.models.spi.MemberDetails property, CollectionType typeAnnotation, MetadataBuildingContext context) -
setMappedBy
-
setTableBinder
-
setElementType
public void setElementType(org.hibernate.models.spi.TypeDetails collectionElementType) -
setTargetEntity
-
setTargetEntity
public void setTargetEntity(org.hibernate.models.spi.ClassDetails targetEntity) -
setTargetEntity
public void setTargetEntity(org.hibernate.models.spi.TypeDetails targetEntity) -
createCollection
-
getCollection
-
setPropertyName
-
setDeclaringClass
public void setDeclaringClass(org.hibernate.models.spi.ClassDetails declaringClass) -
bind
public void bind() -
bindStarToManySecondPass
return true if it's a Fk, false if it's an association table -
bindOneToManySecondPass
Bind aOneToMany
association. -
setCache
-
setQueryCacheLayout
-
setOneToMany
public void setOneToMany(boolean oneToMany) -
setIndexColumn
-
setMapKey
-
adjustUserSuppliedValueCollectionOrderingFragment
-
mappingDefinedAttributeOverrideOnElement
protected boolean mappingDefinedAttributeOverrideOnElement(org.hibernate.models.spi.MemberDetails property) -
setOnDeleteActionAction
-
bindManyToManyInverseForeignKey
public void bindManyToManyInverseForeignKey(PersistentClass targetEntity, AnnotatedJoinColumns joinColumns, SimpleValue value, boolean unique) Bind the inverse foreign key of aManyToMany
, that is, the columns specified by@JoinTable(inverseJoinColumns=...)
, which are the columns that reference the target entity of the many-to-many association. If we are in amappedBy
case, read the columns from the associated collection element in the target entity. -
setFkJoinColumns
-
setExplicitAssociationTable
public void setExplicitAssociationTable(boolean isExplicitAssociationTable) -
setElementColumns
-
setEmbedded
public void setEmbedded(boolean annotationPresent) -
setProperty
public void setProperty(org.hibernate.models.spi.MemberDetails property) -
getNotFoundAction
-
setNotFoundAction
-
setMapKeyColumns
-
setMapKeyManyToManyColumns
-
setLocalGenerators
-