For Single valued associations, i.e.-One-to-One and Many-to-One:-
Default Lazy=proxy
Proxy lazy loading:- This implies a proxy object of your associated entity is loaded. This means that only the id connecting the two entities is loaded for the proxy object of associated entity.
Eg: A and B are two entities with Many to one association. ie: There may be multiple A's for every B. Every object of A will contain a reference of B.
`
public class A{
int aid;
//some other A parameters;
B b;
}
public class B{
int bid;
//some other B parameters;
}
`
The relation A will contain columns(aid,bid,...other columns of entity A).
The relation B will contain columns(bid,...other columns of entity B)
Proxy implies when A is fetched, only id is fetched for B and stored into a proxy object of B which contains only id.
Proxy object of B is a an object of a proxy-class which is a subclass of B with only minimal fields.
Since bid is already part of relation A, it is not necessary to fire a query to get bid from the relation B.
Other attributes of entity B are lazily loaded only when a field other than bid is accessed.
For Collections, i.e.-Many-to-Many and One-to-Many:-
Default Lazy=true
Please also note that the fetch strategy(select,join etc) can override lazy.
ie: If lazy='true' and fetch='join', fetching of A will also fetch B or Bs(In case of collections). You can get the reason if you think about it.
Default fetch for single valued association is "join".
Default fetch for collections is "select".
Please verify the last two lines. I have deduced that logically.