Commit 7dd8e9af authored by Matija Obreza's avatar Matija Obreza
Browse files

Dataset API updates

- AccessionIdentifier should not deserialize `accessionId`
- Locations should not be updated when updating basic data
parent 8c0c3f6d
...@@ -28,6 +28,8 @@ import org.genesys2.server.model.impl.AccessionIdentifier3; ...@@ -28,6 +28,8 @@ import org.genesys2.server.model.impl.AccessionIdentifier3;
import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference; import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.annotation.ObjectIdGenerators; import com.fasterxml.jackson.annotation.ObjectIdGenerators;
/** /**
...@@ -68,6 +70,7 @@ public class AccessionIdentifier implements AccessionIdentifier3, Serializable { ...@@ -68,6 +70,7 @@ public class AccessionIdentifier implements AccessionIdentifier3, Serializable {
@JoinColumn(name = "accessionId", nullable = true) @JoinColumn(name = "accessionId", nullable = true)
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "uuid") @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "uuid")
@JsonIdentityReference(alwaysAsId = true) @JsonIdentityReference(alwaysAsId = true)
@JsonProperty(access = Access.READ_ONLY)
private AccessionId accession; private AccessionId accession;
/** /**
......
...@@ -52,7 +52,6 @@ import org.genesys2.server.model.genesys.Accession; ...@@ -52,7 +52,6 @@ import org.genesys2.server.model.genesys.Accession;
import org.genesys2.server.model.genesys.AccessionId; import org.genesys2.server.model.genesys.AccessionId;
import org.genesys2.server.persistence.AccessionRepository; import org.genesys2.server.persistence.AccessionRepository;
import org.genesys2.server.security.SecurityUtils; import org.genesys2.server.security.SecurityUtils;
import org.genesys2.server.service.GenesysService;
import org.genesys2.util.JPAUtils; import org.genesys2.util.JPAUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -573,17 +572,6 @@ public class DatasetServiceImpl implements DatasetService { ...@@ -573,17 +572,6 @@ public class DatasetServiceImpl implements DatasetService {
target.getCrops().clear(); target.getCrops().clear();
target.getCrops().addAll(source.getCrops()); target.getCrops().addAll(source.getCrops());
} }
if (source.getLocations() != null) {
if (target.getLocations() == null) {
target.setLocations(new ArrayList<>());
}
if(target != source) {
target.getLocations().clear();
target.getLocations().addAll(source.getLocations());
}
}
// target.setDescriptors(source.getDescriptors());
} }
/** /**
......
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