Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
book-of-vaadin.pdf
Скачиваний:
88
Добавлен:
24.03.2015
Размер:
13.43 Mб
Скачать

Vaadin JPAContainer

Figure 21.3. Object-Relational Mapping

The entity relationships are declared with metadata. With Vaadin JPAContainer, you provide the metadata with annotations in the entity classes. The JPA implementation uses reflection to read the annotations and defines a database model automatically from the class definitions. Definition of the domain model and the annotations are described in Section 21.3.1, “Persistence Metadata”.

The main interface in JPA is the EntityManager, which allows making different kinds of queries either with the Java Persistence Query Language (JPQL), native SQL, or the Criteria API in JPA 2.0.You can always use the interface directly as well, using Vaadin JPAContainer only for binding the data to the user interface.

Vaadin JPAContainer supports JPA 2.0 (JSR 317). It is available under the Apache License 2.0.

JPAContainer Concepts

The JPAContainer is an implementation of the Vaadin Container interface that you can bind to user interface components such as Table, Select, etc.

The data access to the persistent entities is handled with a entity provider, as defined in the EntityProvider interface. JPAContainer provides a number of different entity providers for different use cases and optimizations.The built-in providers are described in Section 21.5, “Entity Providers”.

Documentation and Support

In addition to this chapter in the book, the installation package includes the following documentation about JPAContainer:

API Documentation

JPAContainer Tutorial

JPAContainer AddressBook Demo

JPAContainer Demo

21.2.Installing

Vaadin JPAContainer can be installed either as an installation package, downloaded from the Vaadin Directory, or as a Maven dependency. You can also create a new JPAContainer-enabled Vaadin project using a Maven archetype.

JPAContainer Concepts

453

Vaadin JPAContainer

21.2.1. Downloading the Package

Vaadin JPAContainer is available for download from the Vaadin Directory [http://vaadin.com/directory]. Please see Section 17.2, “Downloading Add-ons from Vaadin Directory” for basic instructions for downloading from Directory. The download page also gives the dependency declaration needed for retrieving the library with Maven.

JPAContainer is a purely server-side component, so it does not include a widget set that you would need to compile.

21.2.2. Installation Package Content

Once extracted to a local folder, the contents of the installation directory are as follows:

README

A readme file describing the package contents.

licensing.txt

General information about licensing of JPAContainer.

license-xxxx-y.y.txt

The full license text for the library.

vaadin-jpacontainer-xxxx-y.y-z.z.z.jar

The actual Vaadin JPAContainer library.The xxxx is the license name and y.y its version number. The final z.z.z is the version number of the Vaadin JPAContainer.

vaadin-jpacontainer-xxxx-y.y-z.z.z-javadoc.jar

JavaDoc documentation JAR for the library. You can use it for example in Eclipse by associating the JavaDoc JAR with the JPAContainer JAR in the build path settings of your project.

apidocs

A folder containing the JavaDoc API documentation in plain HTML.

jpacontainer-tutorial.pdf

The tutorial in PDF format.

jpacontainer-tutorial

The tutorial in HTML format. The online version of the tutorial is always available at v a a d i n . c o m / d o w n l o a d / j p a c o n t a i n e r - t u t o r i a l / [http://vaadin.com/download/jpacontainer-tutorial/].

jpacontainer-addressbook-demo

The JPAContainer AddressBook Demo project covered in this tutorial.You can compile and package the application as a WAR with "mvn package" or launch it in the Jetty web browser with "mvn jetty:run".You can also import the demo project in Eclipse as described in the tutorial.

jpacontainer-demo-z.z.z.war

The basic JPAContainer demo. It is somewhat more extensive than the AddressBook Demo.

454

Downloading the Package

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]