diff --git a/api-evolution/README.adoc b/api-evolution/README.adoc index 76b4be6..e61678d 100644 --- a/api-evolution/README.adoc +++ b/api-evolution/README.adoc @@ -26,7 +26,7 @@ We all must start somewhere. So imagine you created an employee representation l @Data @NoArgsConstructor @Entity -class Employee implements Identifiable { +class Employee { @Id @GeneratedValue private Long id; @@ -174,7 +174,6 @@ There are many advantages: * Decouples the client from the server. * Clients may not want ALL the fields. * This client doesn't talk to a data store, so no JPA annotations. -* This client isn't used to form links, to no need to implement the `Identifiable` interface. * This client isn't used to fashion test data (yet), so no need for special constructors. All in all, it's enough to give it the empty constructor so Jackson can handle serializing/deserializing data over the wire. @@ -347,7 +346,7 @@ Looking into link:new-server[new-server], the updated `Employee` domain object c @Data @NoArgsConstructor @Entity -class Employee implements Identifiable { +class Employee { @Id @GeneratedValue private Long id; diff --git a/basics/README.adoc b/basics/README.adoc index 1e9841c..c5b48f1 100644 --- a/basics/README.adoc +++ b/basics/README.adoc @@ -17,7 +17,7 @@ The cornerstone of any example is the domain object: @NoArgsConstructor(access = AccessLevel.PRIVATE) @AllArgsConstructor @JsonIgnoreProperties(ignoreUnknown = true) -class Employee implements Identifiable { +class Employee { @Id @GeneratedValue private Long id; @@ -40,9 +40,6 @@ This domain object includes: * `@AllArgsConstructor` - Lombok annotation to create an all-arg constructor for certain test scenarios * `@JsonIgnoreProperties(ignoreUnknown=true)` - Jackson annotation to ignore unknown attributes when deserializing JSON. -It also implements `Identifiable`, which comes with a single method, `getId`, used to fetch the unique identifier -for a given entity. - NOTE: Make your REST resources robust by instructing Jackson to ignore unknown attributes. That way, additional elements, like hypermedia (HAL *_links*, HAL-Forms *_templates*, etc.) and newer attributes will be discarded. diff --git a/hypermedia/README.adoc b/hypermedia/README.adoc index 8204116..648f8b8 100644 --- a/hypermedia/README.adoc +++ b/hypermedia/README.adoc @@ -26,7 +26,7 @@ For starters, here is the basic definition: @Data @Entity @NoArgsConstructor -class Manager implements Identifiable { +class Manager { @Id @GeneratedValue private Long id; @@ -79,7 +79,7 @@ To round things out, you need to make some updates to the `Employee` domain obje @Data @Entity @NoArgsConstructor -class Employee implements Identifiable { +class Employee { @Id @GeneratedValue private Long id;