February 2018
Intermediate to advanced
356 pages
9h 10m
English
We have configured the database connections successfully. Now, we are ready to map our models using the JPA annotations. Let's start with our Category model. It is a pretty simple class, which is good because we are interested in Spring Data JPA stuff.
Our first version of the Category model should be like this:
package springfive.cms.domain.models;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.Id;import javax.persistence.Table;import lombok.Data;import org.hibernate.annotations.GenericGenerator;@Data@Entity@Table(name = "category")public class Category { @Id @GeneratedValue(generator = "system-uuid") @GenericGenerator(name = "system-uuid", strategy = "uuid2") String id ...