Data access APIs
The data access APIs read and write your application's data, and let you subscribe to changes. There are two ways to do this:
- Data access APIs (GPAL / Java) describes the Genesis database APIs.
SyncEntityDb,AsyncEntityDbandRxEntityDbwork through type-safe DAOs generated from your data model; the record-levelSyncDb,AsyncDbandRxDbwork withDbRecords instead. Most server capabilities use these APIs, and they work with every supported database. - Data access APIs (JPA) describes how to use Spring Data JPA and Hibernate in a Spring Boot process. You get repositories, derived queries and
@Transactionalservice methods, and the same tables, record IDs, audit trail andUpdateQueueas the Genesis APIs. It works with SQL databases only. - Write operation listeners describes how to run your own code inside the transaction of every write a process makes.
The Genesis APIs are used throughout the platform. To decide which of them to use, and to see how each one uses threads and connections, read Choosing and using a DB API: use SyncEntityDb from Java and AsyncEntityDb from Kotlin. Choose JPA when your process is already a Spring Boot application and you'd rather work in the Spring programming model. A write made through JPA is published to the rest of the platform just like any other write.
Working with Spring?
Start with Getting Started with Spring, a step-by-step tutorial that sets up a Spring module, then Application core for how Spring is bridged into a Genesis application.