Spring Applications
Exercise: Book Entity
The objective of this exercise is to implement a book entity and a repository with CRUD operations.
- Create and start a PostgreSQL database
bookstore
.
- Implement a
Book
class and add JPA annotations to make it an entity class that conforms to the given SQL schema.
- Implement a
BookRepository
class that creates an entity manager and implements CRUD operations for the Book
entity.
- In the
persistence.xml
configuration file define the persistence unit bookstore
which maps the Book
entity to the bookstore
database.
- Run the BookPersistenceIT integration test.