OpenBooks: A sample JPA 2.0 Application
OpenBooks is a sample (and perhaps simple) application to demonstrate some of the new features of
version 2.0 of Java Persistence API (JPA) specification.
OpenBooks runs with OpenJPA as its JPA provider.
Instructions to run OpenBooks Demo
- Download OpenBooks distribution.
- Install OpenBooks distribution
- Edit for your local environment
- Populate a Database
- Run OpenBooks
Download Instructions
OpenBooks is distributed under Apache License, Version 2.0
OpenBooks can be downloaded from here.
OpenBooks require following software environment to run:
- Java Runtime version 6.0 or higher
- OpenJPA Libraries version 2.0 or higher
- Ant version 1.6 or higher
- Any JDBC complaint database supported by OpenJPA.
See OpenJPA documentation for a list of supported databases.
Unzip openbooks.zip
to a directory. Following instructions assume this directory as
your current directory.
The files included in this distribution are:
index.html : the file you are reading
openbooks.jar : OpenBooks class library
run.xml : Ant script to run OpenBooks
run.properties : The configuration for your execution environment used by Ant script
load.properties : The configuration for loading initial data into OpenBooks.
demo.properties: Properties to configure the demonstation GUI.
META-INF/persistence.xml: The configuration for OpenJPA runtime
slides/: Directory containing the default presentation accompanying this demonstration.
source/: Directory containing the source code for OpenBooks
LICENSE.txt: Apache License
NOTICE.txt: Copyright Notice
- Edit
run.properties
to specify location of OpenJPA class libraries and JDBC Driver
- Edit
META-INF/persistence.xml
to specify database properties
- Edit
load.properties
to specify load parameters such as number of Books etc.
This example file has some typical values. If you are satisfied with it, you can leave them as it is.
Invoke the Ant script to populate the database.
$ ant -f run.xml load
Invoke the Ant script to run OpenBooks
$ ant -f run.xml run