This is a repo to exercise some Spring framework stuff.
- The controller pulls data from an RDS MySQL DB, the setup scripts can be found in the resources section.
- There is also Spring Rest Data enabled, which means all the endpoints using the entity names are active.
- The Employee entity being available means that the endpoint at /employees is automatically created, with all the HATEOAS stuff that goes with it.
- The extension of the JpaRepository allows for all the DAO stuff to be automatically available, so using repository.save(), repository.findAll() etc for each of the CRUD functions.
- @EnableCaching on the Main application sets the capability, then @Cacheable on a method means caching is available for that method and @CacheEvict means it'll be cleared when the method is triggered.
- /health and /info metrics are available through the /actuator endpoint.
- Aspects are set up to trigger when cache is evicted.
- The pattern can be copied for other annotations, or set via 'execution(* *.methodName(..))' to allow for any params to be passed to a method of method name in any package and with any return type.
Spring Boot Starter readme contents below...
For further reference, please consider the following sections:
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Create an OCI image
- Spring Boot Testcontainers support
- Testcontainers
- Spring Data JPA
- Spring Web
- Rest Repositories
The following guides illustrate how to use some features concretely:
- Accessing Data with JPA
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
- Accessing JPA Data with REST
- Accessing Neo4j Data with REST
- Accessing MongoDB Data with REST
These additional references should also help you:
This project uses Testcontainers at development time.
Testcontainers has been configured to use the following Docker images:
Please review the tags of the used images and set them to the same as you're running in production.