Home Can I change the Fetching strategy upon method call?
Reply: 0

Can I change the Fetching strategy upon method call?

user545
1#
user545 Published in July 21, 2018, 4:59 pm

I was wondering if I can change the Fetching type of an Entity upon the method call, for example, if my entity has a Eager Fetching if I can fetch this entity but in a certain call I fetch using Lazy.

Example:

Object: Car

Integer id;
@ManyToOne(fetch = FetchingType.EAGER)
List<Owners> owners;
String color;





@Fech = Lazy
public fetchEntity(Integer id){

}

So in this method every attribute will be fetched using LAZY instead of EAGER.

Is it possible? thanks!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.317395 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO