Obviusly, criteria queries are more difficult to read if they get more complex-a good reason to prefer them for dynamic and programmatic query generation, but to use externalized hql and JPA Ql for predefined queries.
 
 
 
 
 
 
 
A proxy is initialized if you call any method that is not the identifier Getter
Method, a collection is initialized if you start iterating through its elements or if
You call any of the collection-management operations, such as size () and contains ().
Hibernate provides an additional setting that is mostly useful for large collections; they can be mapped as extra lazy.
 
 
 
 
 
 
 
@ Onetoworkflow
@ Org. hibernate. Annotations. lazycollection (
Org. hibernate. Annotations. lazycollectionoption. Extra
)
Private set <bid> bids = new hashset <bid> ();
 
 
 
 
 
 
 the collection is no longer 
 initialized if you call size (), contains (), or isempty () -The database is queried 
 to retrieve the necessary information. if it's a map or a list, the Operations containskey () 
 and get () also query the database directly.