Jpalite

Requisites

The first requisite is Git as TAQ is distributed from a public Github repository.

The second requisite is Maven as TAQ is organized as a multi-module Maven project.

The third requisite is Java as Jpalite is written in Java,

Installation

Download Jpalite to a suitable development location using Git:

git clone https://github.com/cybersearch2/jpalite

Build with Maven:

mvn clean verify

Sample programs

Two sample programs are provided so show some important capabilities and provide a starting point for evaluating Jpalite. They are:

Jpalite Queries

The JPA specification comes with it's own query language called JPQL. Implementing JPQL would be a major development undertaking not consistent with a lightweight theme. Therefore, the only Jpalite query language is SQL. However, Ormlite provides a Custom Statement Builder which allows statements to be constructed programatically and is incorporated into Jpalite using EntityManagerLite method createNamedQuery().

Named queries are generated at application start up and stored as part of the persistence configuration. Later, when createNamedQuery() is called, the nominated query is returned as a Query object which has methods for setting parameters and performing queries.

Note that a named query can also be applied to a native SQL query and this is necessary for queries that do not return entity objects, for example, getting a count of how many records are in a table.

Here is an example of a query from from the People and Pets Samples

All pets query