aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/moa-id-commons/src')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/ExceptionStore.java103
-rw-r--r--id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml1
2 files changed, 104 insertions, 0 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/ExceptionStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/ExceptionStore.java
new file mode 100644
index 000000000..c439cdb64
--- /dev/null
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/ExceptionStore.java
@@ -0,0 +1,103 @@
+package at.gv.egovernment.moa.id.commons.db.dao.session;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.DynamicUpdate;
+
+
+
+@Entity
+@DynamicUpdate(value=true)
+@Table(name = "exceptionstore")
+@NamedQueries({
+ @NamedQuery(name="getExceptionWithID", query = "select exceptionstore from ExceptionStore exceptionstore where exceptionstore.exid = :id"),
+ @NamedQuery(name="getExceptionWithTimeOut", query = "select exceptionstore from ExceptionStore exceptionstore where exceptionstore.timestamp < :timeout")
+})
+
+public class ExceptionStore implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id", unique=true, nullable=false)
+ private long id;
+
+ @Column(name = "exid", unique=true, nullable=false)
+ private String exid;
+
+ @Column(name = "exception", nullable=false)
+ @Lob private byte [] exception;
+
+ @Column(name = "timestamp", nullable=false)
+ private Date timestamp;
+
+ /**
+ * @return the id
+ */
+ public long getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the exid
+ */
+ public String getExid() {
+ return exid;
+ }
+
+ /**
+ * @param exid the exid to set
+ */
+ public void setExid(String exid) {
+ this.exid = exid;
+ }
+
+ /**
+ * @return the exception
+ */
+ public byte[] getException() {
+ return exception;
+ }
+
+ /**
+ * @param exception the exception to set
+ */
+ public void setException(byte[] exception) {
+ this.exception = exception;
+ }
+
+ /**
+ * @return the timestamp
+ */
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ /**
+ * @param timestamp the timestamp to set
+ */
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+
+}
diff --git a/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml b/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml
index 4841481b6..e40c8b8a9 100644
--- a/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml
+++ b/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml
@@ -10,5 +10,6 @@
<mapping class="at.gv.egovernment.moa.id.commons.db.dao.session.AuthenticatedSessionStore"/>
<mapping class="at.gv.egovernment.moa.id.commons.db.dao.session.OASessionStore"/>
<mapping class="at.gv.egovernment.moa.id.commons.db.dao.session.OldSSOSessionIDStore"/>
+ <mapping class="at.gv.egovernment.moa.id.commons.db.dao.session.ExceptionStore"/>
</session-factory>
</hibernate-configuration> \ No newline at end of file