Integrating with persistence in the Micronaut framework
To exhibit integration with persistence (database) in the Micronaut framework, we will work on three different microservices within the pet-clinic
application:
Hibernate and MyBatis are persistence frameworks for relational databases, whereas to integrate with NoSQL (MongoDB), we will use its native synchronous driver.
In the following sections, we will cover each integration technique by doing hands-on work with the respective microservice. Each microservice (for the scope of this chapter) will be componentized into the following types of components:
- Entity: To encapsulate ORMs
- Repository: To encapsulate interaction to the underlying Hibernate framework
- Service: To contain any business logic as well as concierge calls to the downstream repository
- CLI client: To connect create-read-update-delete (CRUD) requests to the...