Domain model and a repository

A domain model in our service will be a Book class, defined in the Book.java file:

package pl.finsys.example.domain; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @Entity public class Book { @Id @NotNull @Column(name = "id", nullable = false, updatable = false) private Long id; @NotNull @Size(max = 64) @Column(name = "author", nullable = false) private String author; @NotNull @Size(max = 64) @Column(name = "title", nullable = false) private String title; public Book() { } public Book(final Long id, final String author, final String title) { this.id = id; this.title = title; this.author ...

Get Docker and Kubernetes for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.