Package org.hibernate

Class EntityFilterException

  • All Implemented Interfaces:
    Serializable

    public class EntityFilterException
    extends EntityNotFoundException
    Thrown if an enabled filter would filter out the target of a @ManyToOne or @OneToOne association.

    By default, a filter does not apply to to-one association fetching, and this exception does not occur. However, if a filter is explicitly declared applyToLoadByKey = true, then the filter is applied, and it's possible that a filtered entity is the target of a to-one association belonging to an unfiltered entity. Replacing such a filtered object with null would lead to data loss, and so filtering never results in such replacement. Instead, this exception is thrown to indicate the inconsistency of the data with the filter definition.

    See Also:
    FilterDef.applyToLoadByKey(), Serialized Form
    • Constructor Detail

      • EntityFilterException

        public EntityFilterException​(String entityName,
                                     Object identifier,
                                     String role)
    • Method Detail

      • getEntityName

        public String getEntityName()
      • getIdentifier

        public Object getIdentifier()
      • getRole

        public String getRole()