Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Provided a Value Encoders section that links to the Hibernate User Guide

...

Code Block
languagejava
titleUserDaoImpl
public class UserDaoImpl implements UserDao {
   @Inject
   @PersistenceContext(unitName = "DemoUnit")
   private EntityManager entityManager;

   ...
}

Value Encoders

The Tapestry-jpa module automatically provides value encoders to make it easy to work with entities (especially lists of entities) in your Tapestry pages and components. This is modeled on the similar functionality from the Tapestry-hibernate-core module. See the Hibernate User Guide for all the details.

Transaction management

As you may already know from the Hibernate integration library, Tapestry automatically manages transactions for you. The JPA integration library defines the @CommitAfter annotation, which acts as the correspondent annotation from the Hibernate integration library. Let’s explore the UserDao interface to see the annotation in action.

...