aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java
diff options
context:
space:
mode:
authorChristian Wagner <c.wagner@datentechnik-innovation.com>2015-02-03 09:17:14 +0100
committerChristian Wagner <c.wagner@datentechnik-innovation.com>2015-02-03 09:17:14 +0100
commit9a94ecf85e323321e23df8a93ad206c4a699d3fd (patch)
tree19656a1beb77cd58aa3c73725e8d396b86a6fb6c /id/server/idserverlib/src/main/java
parent036c31a1dcff04784946159c2612e48bf2ec9e0e (diff)
downloadmoa-id-spss-9a94ecf85e323321e23df8a93ad206c4a699d3fd.tar.gz
moa-id-spss-9a94ecf85e323321e23df8a93ad206c4a699d3fd.tar.bz2
moa-id-spss-9a94ecf85e323321e23df8a93ad206c4a699d3fd.zip
serialize ExecutionContext data in a single database field
Diffstat (limited to 'id/server/idserverlib/src/main/java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java
index 625199cd2..c6bf86823 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java
@@ -1,19 +1,18 @@
package at.gv.egovernment.moa.id.process.dao;
import java.io.Serializable;
-import java.util.HashMap;
import java.util.Map;
import javax.persistence.Column;
-import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
+import org.hibernate.internal.util.SerializationHelper;
+
import at.gv.egovernment.moa.id.process.ProcessInstanceState;
@Entity
@@ -39,8 +38,7 @@ public class ProcessInstanceStore {
@Column(name = "executionContextData", nullable = false)
@Lob
- @ElementCollection(fetch=FetchType.EAGER)
- private Map<String, Serializable> executionContextData = new HashMap<>();
+ private byte[] executionContextData;
public String getProcessInstanceId() {
return processInstanceId;
@@ -58,8 +56,9 @@ public class ProcessInstanceStore {
return processState;
}
+ @SuppressWarnings("unchecked")
public Map<String, Serializable> getExecutionContextData() {
- return executionContextData;
+ return (Map<String, Serializable>) SerializationHelper.deserialize(executionContextData);
}
public void setProcessInstanceId(String processInstanceId) {
@@ -79,7 +78,7 @@ public class ProcessInstanceStore {
}
public void setExecutionContextData(Map<String, Serializable> executionContextData) {
- this.executionContextData = executionContextData;
+ this.executionContextData = SerializationHelper.serialize((Serializable) executionContextData);
}
}