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

  1. Download OpenBooks distribution.
  2. Install OpenBooks distribution
  3. Edit for your local environment
  4. Populate a Database
  5. 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:

  1. Java Runtime version 6.0 or higher
  2. OpenJPA Libraries version 2.0 or higher
  3. Ant version 1.6 or higher
  4. Any JDBC complaint database supported by OpenJPA. See OpenJPA documentation for a list of supported databases.

Install OpenBooks distribution

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


    Configure OpenBooks for your local environment

    1. Edit run.properties to specify location of OpenJPA class libraries and JDBC Driver
    2. Edit META-INF/persistence.xml to specify database properties
    3. 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.

    Populate a Database

    Invoke the Ant script to populate the database.
    $ ant -f run.xml load

    Run OpenBooks

    Invoke the Ant script to run OpenBooks
    $ ant -f run.xml run