Spring Applications

Exercise: Book Entity

The objective of this exercise is to implement a book entity and a repository with CRUD operations.
  1. Create and start a PostgreSQL database bookstore.
  2. Implement a Book class and add JPA annotations to make it an entity class that conforms to the given SQL schema.
  3. Implement a BookRepository class that creates an entity manager and implements CRUD operations for the Book entity.
  4. Place the configuration file persistence.xml, which defines the persistence unit bookstoreconnected to the PostgreSQL database, in the resources/META-INF folder.
  5. Add the SQL script data.sql, which initializes the database with test data, to the same folder and run the BookRepositoryIT integration test.