Skip to content

Commit

Permalink
Exposed entity id as entityId field. Thanks HATEOAS for overriding id.
Browse files Browse the repository at this point in the history
  • Loading branch information
czetsuya committed May 13, 2019
1 parent f29df89 commit 1cb3b60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/broodcamp/data/entity/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand All @@ -25,10 +26,17 @@ public class Customer {
private String name;
private int age;
private String email;

@Transient
private Long entityId;

public Customer(String name, int age, String email) {
this.name = name;
this.age = age;
this.email = email;
}

public Long getEntityId() {
return id;
}
}

0 comments on commit 1cb3b60

Please sign in to comment.