Pustike Persist

Pustike Persist is an object based persistence library. Using a simple configuration and annotation based entity mapping, it provides features like schema generation, sql query api to insert / update / delete objects and a fluent data finder api.

Using Java Persistence API is the standard approach to object persistence in Java based applications. And it is a comprehensive and complex API to implement and use. Using a JPA implementation for persistence can add lot of overhead to small/medium sized applications. So, Pustike Persist provides a simple api to perform common SQL queries using object metadata built using JPA like annotations.

Following are some of its key features:

  • Repository configuration using dataSource and schema metadata
  • Entity mapping to database table and fields to columns using annotations
  • Database schema generation with index, foreign keys, constraints, etc using the mapping tool
  • Allows field group definitions per entity to fetch or update only the required data
  • Insert single/list of objects into database in batch and support update on conflict using excluded rows
  • Update single/multiple objects in the database using the specified field group
  • Select row data as object with the given identity and option to select them for update with lock
  • Delete single/multiple objects
  • A fluent Finder API to construct sql queries and fetch result data as objects
  • Supported databases: PostgreSQL
  • Requires Java 11 and has no external dependencies (~60kB in size)

Documentation:

  • User Guide is included in the project’s README.md file.
  • Latest API docs are accessible here.

Download:

The most recent release is v0.9.2 (2021-01-25), and it is available from Maven central repository.

To add it as a dependency in Maven builds, use the following:

<dependency>
    <groupId>io.github.pustike</groupId>
    <artifactId>pustike-persist</artifactId>
    <version>0.9.2</version>
</dependency>

Or, download the latest JAR(~60kB) from Maven Central.

License: This library is published under the Apache License, Version 2.0