Remove reference to 'Identifiable'.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user