jpa

Nico Heid's picture

Using an EntityManagerFactory with JPA, Hibernate and Wicket

If you read the previous article "@OneToMany Relationship with Java, Hibernate and Annotations" you might have noticed some
imperfections in the persistence layer. On the code side we have been
lazy by just using FetchType.EAGER. This of course puts extra stress on
the database, because in our example, for each BlogPost all Comments are
fetched, even though they might not be displayed.


Maybe you played around with the example
version 0.1.1(download tarball).
You might have noticed that if you switch to FetchType.LAZY you will
most likely get a no session or session was closed on certain operations.
Read more

Syndicate content