Persist (Java tool)

Persist is a Java-based ORM/DAO tool. It provides only the minimal amount of functionalities necessary to map objects or maps from database queries and to statement parameters.

Persist works around a java.sql.Connection object. This means that it does not care about customer query languages (it uses plain SQL with placeholders, as PreparedStatement objects use), connection pool handling, transaction handling (for the most part), and so on. This also means it is very flexible, and can be integrated with any code that depends on JDBC (including code that already use another ORM/DAO tool).

Persist does not require explicit mappings from POJOs to database tables. As long as there is some sort of naming conventions that relate database names with POJO names, Persist will require virtually no mappings. It can, however, be instructed to map Java classes and fields to database tables and columns using annotations.

Persist supports several different mapping strategies:

POJOs mapped to tables

By default, if no annotations specify a given class should not be mapped to a table, Persist will try to find a table that matches that class and create a mapping between fields and columns.

POJOs not mapped to tables

If a class is annotated with @NoTable, Persist will not try to map it to a table, and the class will only be able to hold data produced by queries.

java.util.Map's

Map's can be used to hold data from queries. Persist will convert values returned from the query to Java types. Keys in the table are the names of the columns returned in lower case.

Java primitive types

If a query returns a single column, Persist can map data directly into primitive types (either single values or lists):

Custom queries with no returning data

Arbitrary queries that return no data can be easily executed.