Holon platform examples: JDBC Datastore
This is one of the Holon Platform example projects.
This example shows how to deal with the basic operations of the
Datastore API, using a JDBC Datastore implementation and a H2 in-memory database.
Spring Boot is used for automatic
Datastore configuration, activated by the
holon-starter-jdbc-datastore-hikaricp starter. See the example pom.
NOTE: This is the JDBC version of the JPA Datastore example.
This example addresses the following topics:
- Automatic setup of a JDBC Datastore using the Holon Platform Spring Boot integration
- Management of a simple data entity using the
DatastoreAPI (create, update, delete, query)
The schema.sql script creates the
products table at application startup time.
The Product class represents the property model for a simple product entity.
WITHDRAWNProduct property is configured with a property value converter to automatically convert the
integertype of the database table column to the
TARGETfield of the Product class is the definition of a named
DataTargetwhich refers to the
productstable name to be used with
The TestDatastore class is a JUnit test class to show how to use the
Datastore API to create, update delete and query the products, relying on the
PropertyBox type to handle the property values.
Run this example
Run the unit test class using
mvn test or your favorite IDE command.
The complete Holon Platform reference guide is available here.
For the specific documentation about the components used in this example see:
The Holon Platform is built using Java 8, so you need a JRE/JDK version 8 or above to build and run this example projects.
Holon Platform Examples
See Holon Platform Examples for the examples directory.