How do I apply a lazy loading strategy only for a given NamedQuery.
eg. Consider the pseudo code below (just to explain the case) I have an entity
@Entity class Xyz { int a; int b; @Fetch = EAGER Set<ABC> listOfItems; }
In this case, we declared listOfItems EAGERLY.
Now suppose I have NamedQuery (query="getXyz" , name="select x from Xyz x where a=?")
For this query, I just need the result to be lazy. If I do not want listOfItems to be restored.
How can I cover them? ps: 1. I do not want listOfItems to be Lazy in the Entity 2 class. I do not want to select specific fields in a query like name="select a,b from Xyz z where a = ? "
Thanks in advance for the suggestions.
source share