I wanted to know whether iBatis can provide support for lazy fetch just like Hibernate supports? For example I have User class which has
public class User {
List<Address> addresses;
public List<Address> getAddresses(){
return addresses;
}
...
}
Now I wanted to implement the lazy fetching when user.getAddresses() is called. Is it possible to achieve this in iBatis? If yes then how?
Thanks for your help.
Sure.
According to documentation, you can set the
lazyLoadattribute of theresultelement of aresultMapfor the property you want to be lazy loaded.E.g.: