Class CollectionBinder

java.lang.Object
org.hibernate.cfg.annotations.CollectionBinder
Direct Known Subclasses:
BagBinder, ListBinder, MapBinder, SetBinder

public abstract class CollectionBinder extends Object
Base class for binding different types of collections to Hibernate configuration objects.
  • Field Details

    • collection

      protected Collection collection
    • propertyName

      protected String propertyName
    • indexColumn

      protected IndexColumn indexColumn
    • hqlOrderBy

      protected String hqlOrderBy
    • cascadeDeleteEnabled

      protected boolean cascadeDeleteEnabled
    • mapKeyPropertyName

      protected String mapKeyPropertyName
    • localGenerators

      protected HashMap<String,IdGenerator> localGenerators
    • inheritanceStatePerClass

      protected Map<XClass,InheritanceState> inheritanceStatePerClass
  • Constructor Details

    • CollectionBinder

      protected CollectionBinder()
    • CollectionBinder

      protected CollectionBinder(boolean sorted)
  • Method Details

    • getMappings

      protected Mappings getMappings()
    • isMap

      public boolean isMap()
    • setIsHibernateExtensionMapping

      public void setIsHibernateExtensionMapping(boolean hibernateExtensionMapping)
    • isHibernateExtensionMapping

      protected boolean isHibernateExtensionMapping()
    • setUpdatable

      public void setUpdatable(boolean updatable)
    • setInheritanceStatePerClass

      public void setInheritanceStatePerClass(Map<XClass,InheritanceState> inheritanceStatePerClass)
    • setInsertable

      public void setInsertable(boolean insertable)
    • setCascadeStrategy

      public void setCascadeStrategy(String cascadeStrategy)
    • setAccessType

      public void setAccessType(AccessType accessType)
    • setInverseJoinColumns

      public void setInverseJoinColumns(Ejb3JoinColumn[] inverseJoinColumns)
    • setJoinColumns

      public void setJoinColumns(Ejb3JoinColumn[] joinColumns)
    • setPropertyHolder

      public void setPropertyHolder(PropertyHolder propertyHolder)
    • setBatchSize

      public void setBatchSize(BatchSize batchSize)
    • setEjb3OrderBy

      public void setEjb3OrderBy(javax.persistence.OrderBy orderByAnn)
    • setSqlOrderBy

      public void setSqlOrderBy(OrderBy orderByAnn)
    • setSort

      public void setSort(Sort sortAnn)
    • getCollectionBinder

      public static CollectionBinder getCollectionBinder(String entityName, XProperty property, boolean isIndexed, boolean isHibernateExtensionMapping)
      collection binder factory
    • setMappedBy

      public void setMappedBy(String mappedBy)
    • setTableBinder

      public void setTableBinder(TableBinder tableBinder)
    • setCollectionType

      public void setCollectionType(XClass collectionType)
    • setTargetEntity

      public void setTargetEntity(XClass targetEntity)
    • setMappings

      public void setMappings(Mappings mappings)
    • createCollection

      protected abstract Collection createCollection(PersistentClass persistentClass)
    • getCollection

      public Collection getCollection()
    • setPropertyName

      public void setPropertyName(String propertyName)
    • setDeclaringClass

      public void setDeclaringClass(XClass declaringClass)
    • bind

      public void bind()
    • getSecondPass

      public SecondPass getSecondPass(Ejb3JoinColumn[] fkJoinColumns, Ejb3JoinColumn[] keyColumns, Ejb3JoinColumn[] inverseColumns, Ejb3Column[] elementColumns, Ejb3Column[] mapKeyColumns, Ejb3JoinColumn[] mapKeyManyToManyColumns, boolean isEmbedded, XProperty property, XClass collType, boolean ignoreNotFound, boolean unique, TableBinder assocTableBinder, Mappings mappings)
    • bindStarToManySecondPass

      protected boolean bindStarToManySecondPass(Map persistentClasses, XClass collType, Ejb3JoinColumn[] fkJoinColumns, Ejb3JoinColumn[] keyColumns, Ejb3JoinColumn[] inverseColumns, Ejb3Column[] elementColumns, boolean isEmbedded, XProperty property, boolean unique, TableBinder associationTableBinder, boolean ignoreNotFound, Mappings mappings)
      return true if it's a Fk, false if it's an association table
    • bindOneToManySecondPass

      protected void bindOneToManySecondPass(Collection collection, Map persistentClasses, Ejb3JoinColumn[] fkJoinColumns, XClass collectionType, boolean cascadeDeleteEnabled, boolean ignoreNotFound, String hqlOrderBy, Mappings mappings, Map<XClass,InheritanceState> inheritanceStatePerClass)
    • setCache

      public void setCache(Cache cacheAnn)
    • setOneToMany

      public void setOneToMany(boolean oneToMany)
    • setIndexColumn

      public void setIndexColumn(IndexColumn indexColumn)
    • setMapKey

      public void setMapKey(javax.persistence.MapKey key)
    • bindManyToManySecondPass

      protected void bindManyToManySecondPass(Collection collValue, Map persistentClasses, Ejb3JoinColumn[] joinColumns, Ejb3JoinColumn[] inverseJoinColumns, Ejb3Column[] elementColumns, boolean isEmbedded, XClass collType, boolean ignoreNotFound, boolean unique, boolean cascadeDeleteEnabled, TableBinder associationTableBinder, XProperty property, PropertyHolder parentPropertyHolder, String hqlOrderBy, Mappings mappings) throws MappingException
      Throws:
      MappingException
    • setCascadeDeleteEnabled

      public void setCascadeDeleteEnabled(boolean onDeleteCascade)
    • bindManytoManyInverseFk

      public static void bindManytoManyInverseFk(PersistentClass referencedEntity, Ejb3JoinColumn[] columns, SimpleValue value, boolean unique, Mappings mappings)
      bind the inverse FK of a ManyToMany If we are in a mappedBy case, read the columns from the associated colletion element Otherwise delegates to the usual algorithm
    • setFkJoinColumns

      public void setFkJoinColumns(Ejb3JoinColumn[] ejb3JoinColumns)
    • setExplicitAssociationTable

      public void setExplicitAssociationTable(boolean explicitAssocTable)
    • setElementColumns

      public void setElementColumns(Ejb3Column[] elementColumns)
    • setEmbedded

      public void setEmbedded(boolean annotationPresent)
    • setProperty

      public void setProperty(XProperty property)
    • setIgnoreNotFound

      public void setIgnoreNotFound(boolean ignoreNotFound)
    • setMapKeyColumns

      public void setMapKeyColumns(Ejb3Column[] mapKeyColumns)
    • setMapKeyManyToManyColumns

      public void setMapKeyManyToManyColumns(Ejb3JoinColumn[] mapJoinColumns)
    • setLocalGenerators

      public void setLocalGenerators(HashMap<String,IdGenerator> localGenerators)