diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-09-15 13:42:36 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-09-15 13:42:36 +0200 |
commit | 8074865580b5fa28817b37c9ad2e8c992ebef977 (patch) | |
tree | 475cd1ed9bc517dffbf023e7d9c7d16ce2bde8c5 /id/server/moa-id-commons/src/main/java/at/gv | |
parent | 234f17d14f9f48655c27d54114df0aa2593cf6d8 (diff) | |
parent | 714a8cb32dd5585829dfc1926e56971425a2a692 (diff) | |
download | moa-id-spss-8074865580b5fa28817b37c9ad2e8c992ebef977.tar.gz moa-id-spss-8074865580b5fa28817b37c9ad2e8c992ebef977.tar.bz2 moa-id-spss-8074865580b5fa28817b37c9ad2e8c992ebef977.zip |
Merge branch 'moa-2.1-Snapshot'
Conflicts:
id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OATargetConfiguration.java
pom.xml
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv')
3 files changed, 9 insertions, 6 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java index 88220cded..46d3ca558 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java @@ -31,6 +31,8 @@ import org.apache.commons.lang.StringEscapeUtils; import javax.persistence.EntityManager; import javax.persistence.PersistenceException; + +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -65,7 +67,7 @@ public class ConfigurationDBRead { List result; EntityManager session = ConfigurationDBUtils.getCurrentSession(); - + javax.persistence.Query query = session.createQuery(QUERIES.get("getActiveOnlineApplicationWithID")); //query.setParameter("id", id+"%"); query.setParameter("id", StringEscapeUtils.escapeHtml(id)); @@ -147,8 +149,8 @@ public class ConfigurationDBRead { Logger.trace("Found entries: " + result.size()); if (result.size() == 0) { - Logger.trace("No entries found."); - return null; + Logger.trace("No entries found. Create fresh instance."); + return new MOAIDConfiguration(); } return (MOAIDConfiguration) result.get(0); @@ -221,7 +223,8 @@ public class ConfigurationDBRead { if (result.size() == 0) { Logger.trace("No entries found."); - return null; + result = new ArrayList<OnlineApplication>(); + } return result; } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java index 6bd987f96..cdb19340d 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java @@ -154,7 +154,7 @@ public final class ConfigurationDBUtils { synchronized (session) { tx.begin(); - session.persist(dbo); + session.merge(dbo); tx.commit(); //session.clear(); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java index c83bb20ca..97f26812f 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java @@ -40,7 +40,7 @@ import org.hibernate.annotations.DynamicUpdate; @Entity @DynamicUpdate(value=true) -@Table(name = "statisiclog") +@Table(name = "statisticlog") @NamedQueries({ @NamedQuery(name="getAllEntriesNotBeforeTimeStamp", query = "select statisiclog from StatisticLog statisiclog where statisiclog.timestamp > :timeout") }) |