This chapter describes the use of the Vaadin JPAContainer add-on.

Vaadin JPAContainer add-on makes it possible to bind user interface components to a database easily using the Java Persistence API (JPA). It is an implementation of the Container interface described in Section 9.4, “Collecting Items in Containers”. It supports a typical three-layer application architecture with an intermediate domain model between the user interface and the data access layer.


The role of Java Persistence API is to handle persisting the domain model in the database. The database is typically a relational database. Vaadin JPAContainer binds the user interface components to the domain model and handles database access with JPA transparently.

JPA is really just an API definition and has many alternative implementations. Vaadin JPAContainer supports especially EclipseLink, which is the reference implementation of JPA, and Hibernate. Any other compliant implementation should work just as well. The architecture of an application using JPAContainer is shown in Figure 18.2, “JPAContainer Architecture”.


Vaadin JPAContainer also plays together with the Vaadin Bean Validation add-on, which brings Java Bean Validation (JSR 303) to Vaadin applications.