Bernardo-MG / jpa-example

An example showing how to set up and test JPA classes.
MIT License
0 stars 0 forks source link
criteria-api example jpa persistence

JPA Example

An example showing how to set up and test JPA classes.

Release docs Development docs

Release javadocs Development javadocs

Features

The project offers examples showing how to set up and test JPA classes, covering the following cases:

Documentation

Documentation is always generated for the latest release, kept in the 'master' branch:

Documentation is also generated from the latest snapshot, taken from the 'develop' branch:

The documentation site sources come along the source code (as it is a Maven site), so it is always possible to generate them using the following Maven command:

mvn verify site -P h2,eclipselink

The verify phase is required, as otherwise some of the reports won't be created.

Usage

The application is coded in Java, using Maven to manage the project.

Profiles

Maven profiles are included for setting up the database and JPA provider.

Profile Database
h2 H2 in-memory database
hsqldb HSQLDB in-memory database
mysql MySQL database
postgres PostgreSQL database
Profile Provider
hibernate Hibernate
eclipselink Eclipselink

Running the tests

The project requires a database and a JPA provider for being able to run the integration tests:

mvn verify -P h2,eclipselink

Missing JPA metadata

Currently there are some problems when generating the JPA metadata classes automatically. Mainly that they are not generated when trying to refresh the Maven project on Eclipse.

To fix this just package the project:

mvn package

Collaborate

Any kind of help with the project will be well received, and there are two main ways to give such help:

Issues management

Issues are managed at the GitHub project issues tracker, where any Github user may report bugs or ask for new features.

Getting the code

If you wish to fork or modify the code, visit the GitHub project page, where the latest versions are always kept. Check the 'master' branch for the latest release, and the 'develop' for the current, and stable, development version.

License

The project has been released under the MIT License.