vlad wrote:
The most efficient way of fetching data with JPA and Hibernate is a JPQL query which allows you to control the size of the fetched elements without any limitation. If you're referring to limiting a collection size while you fetch it eagerly, that's not possible since Hibernate has to fetch it fully.
If you're referring to JDBC fetch size, that can be set with the
hibernate.jdbc.fetch_size configuration property.
Thanks first.
I think the query way sometimes hard to manage, especially when u want to change or expand the attributes of ur entity(name or structure). Thus, I prefer using the JPA Metadata Model.
Now I know that the entityGraph fetching is eager only, but what about the CriteriaQuery?
Size can be controlled in CriteriaQuery where JPA Metadata Model is available?