Remove reference to 'Identifiable'.

This commit is contained in:
Greg Turnquist
2019-07-30 10:40:43 -05:00
parent e1de36b47c
commit 6ab1d7f571
3 changed files with 5 additions and 9 deletions

View File

@@ -26,7 +26,7 @@ We all must start somewhere. So imagine you created an employee representation l
@Data
@NoArgsConstructor
@Entity
class Employee implements Identifiable<Long> {
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<T>` 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<Long> {
class Employee {
@Id @GeneratedValue
private Long id;

View File

@@ -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<Long> {
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<Long>`, 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.

View File

@@ -26,7 +26,7 @@ For starters, here is the basic definition:
@Data
@Entity
@NoArgsConstructor
class Manager implements Identifiable<Long> {
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<Long> {
class Employee {
@Id @GeneratedValue
private Long id;