- adds json annotation '@JsonIdentityInfo' to many-to-many relationships of exportable classes

git-svn-id: https://svn.libreccm.org/ccm/trunk@4498 8810af33-2d31-482b-a856-94f89814c4df
master
tosmers 2016-12-20 22:52:01 +00:00
parent 916b622a36
commit 52e45ed151
2 changed files with 19 additions and 10 deletions

View File

@ -77,14 +77,18 @@ public class AssignableTaskConversion {
AssignableTask assignableTask = new AssignableTask(trunkUserTask);
// set workflow and opposed associations
if (trunkUserTask.getWorkflow() != null) {
Workflow workflow = NgCollection.workflows.get(
trunkUserTask.getWorkflow().getID().longValue());
if (workflow != null) {
assignableTask.setWorkflow(workflow);
workflow.addTask(assignableTask);
com.arsdigita.workflow.simple.Workflow userTaskWorkflow = null;
try {
userTaskWorkflow = trunkUserTask.getWorkflow();
if (userTaskWorkflow != null) {
Workflow workflow = NgCollection.workflows.get(
userTaskWorkflow.getID().longValue());
if (workflow != null) {
assignableTask.setWorkflow(workflow);
workflow.addTask(assignableTask);
}
}
}
} catch (Exception e) {}
// set taskComments
Iterator commentsIt = trunkUserTask.getComments();

View File

@ -22,7 +22,8 @@ import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.l10n.LocalizedString;
import com.arsdigita.portation.modules.core.workflow.util.StateMapper;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import java.util.ArrayList;
import java.util.List;
@ -47,9 +48,13 @@ public class Task {
@JsonBackReference
private Workflow workflow;
@JsonManagedReference
@JsonIdentityInfo(
generator = ObjectIdGenerators.PropertyGenerator.class,
property = "taskId")
private List<Task> dependentTasks;
@JsonBackReference
@JsonIdentityInfo(
generator = ObjectIdGenerators.PropertyGenerator.class,
property = "taskId")
private List<Task> dependsOn;
private List<TaskComment> comments;