Package org.hibernate
Class EntityFilterException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- jakarta.persistence.PersistenceException
-
- jakarta.persistence.EntityNotFoundException
-
- org.hibernate.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 withnull
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 Summary
Constructors Constructor Description EntityFilterException(String entityName, Object identifier, String role)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEntityName()
Object
getIdentifier()
String
getRole()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-