Commit 5963a1e2 authored by Matija Obreza's avatar Matija Obreza

Fix: FaoInstitute#owner is serialized to JSON, but not deserialized

- Fixes JSON parse error: Already had POJO for id...
parent 3b833acf
......@@ -25,7 +25,18 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.*;
import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.MapKey;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
......@@ -45,6 +56,8 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.fasterxml.jackson.databind.ObjectMapper;
......@@ -120,12 +133,14 @@ public class FaoInstitute extends BasicModel implements GeoReferencedEntity, Acl
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "slug")
@JsonIdentityReference(alwaysAsId = true)
@Field(index = FieldIndex.not_analyzed, type = FieldType.String)
@JsonProperty(access = Access.READ_ONLY)
private List<Organization> networks;
@ManyToOne(cascade = {})
@JoinColumn(name = "partnerId")
@JsonView({ JsonViews.Public.class })
@JsonProperty(access = Access.READ_ONLY)
private Partner owner;
private long accessionCount;
......@@ -140,6 +155,7 @@ public class FaoInstitute extends BasicModel implements GeoReferencedEntity, Acl
private Double pdciMax;
private Double pdciAvg;
@Column(name = "pdciHistogram")
@JsonProperty(access = Access.READ_ONLY)
private String pdciHistogram;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment