Package cz.encircled.joiner.feature
Class PostQueryLazyFetchBlockerFeature
java.lang.Object
cz.encircled.joiner.feature.PostQueryLazyFetchBlockerFeature
- All Implemented Interfaces:
QueryFeature
Use this query feature to prevent uninitialized lazy attributes from being fetched when accessed.
Uninitialized attributes will be initialized with an empty collection or null for singular associations.
This works only with Hibernate stateless sessions, which can be enabled at the query level or globally using
JoinerProperties.setUseStatelessSessions(boolean))-
Constructor Summary
ConstructorsConstructorDescriptionPostQueryLazyFetchBlockerFeature(jakarta.persistence.EntityManager entityManager) -
Method Summary
Modifier and TypeMethodDescriptioncreateEmptyValue(Type javaType) <T,R> void postLoad(JoinerQuery<T, R> request, List<R> result) This method is invoked after the result set is fetched, similar to JPA @PostLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cz.encircled.joiner.query.QueryFeature
after, before
-
Constructor Details
-
PostQueryLazyFetchBlockerFeature
public PostQueryLazyFetchBlockerFeature(jakarta.persistence.EntityManager entityManager)
-
-
Method Details
-
postLoad
Description copied from interface:QueryFeatureThis method is invoked after the result set is fetched, similar to JPA @PostLoad- Specified by:
postLoadin interfaceQueryFeature- Type Parameters:
T- query fromR- query return type- Parameters:
request- initial joiner request
-
createEmptyValue
-