Added @JsonIdentityInfo.

This commit is contained in:
neviyn 2018-09-19 14:31:54 +01:00
parent c8a8edbbc7
commit b4c6773713
3 changed files with 17 additions and 10 deletions

View File

@ -1,15 +1,15 @@
package uk.co.neviyn.Observations.core; package uk.co.neviyn.Observations.core;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
import lombok.*; import lombok.*;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@ -19,6 +19,7 @@ import javax.persistence.*;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Observation extends BaseEntity implements Serializable { public class Observation extends BaseEntity implements Serializable {
@JsonProperty @JsonProperty

View File

@ -1,13 +1,15 @@
package uk.co.neviyn.Observations.core; package uk.co.neviyn.Observations.core;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import java.io.Serializable;
import java.util.Set;
import lombok.*; import lombok.*;
import javax.persistence.*; import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Set;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@ -16,6 +18,7 @@ import javax.persistence.*;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@RequiredArgsConstructor @RequiredArgsConstructor
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Site extends BaseEntity implements Serializable { public class Site extends BaseEntity implements Serializable {
@NonNull @NonNull

View File

@ -1,6 +1,8 @@
package uk.co.neviyn.Observations.core; package uk.co.neviyn.Observations.core;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.*; import lombok.*;
import javax.persistence.*; import javax.persistence.*;
@ -15,6 +17,7 @@ import java.util.Set;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Tutor extends BaseEntity implements Serializable { public class Tutor extends BaseEntity implements Serializable {
@NonNull @NonNull