Example with Spring Data JPA

Learn how to implement a persistence adapter with the help of an example in Spring Data JPA.

The Account data class

Let’s look at a code example that implements the AccountPersistenceAdapter from the figures in the previous lessons. This adapter will have to save and load accounts to and from the database. We have already seen the Account entity in chapter “Implementing a Use Case”, but here is its skeleton again for reference:

Get hands-on with 1400+ tech skills courses.