diff options
author | Gerwin Gsenger <g.gsenger@datentechnik-innovation.at> | 2015-01-16 16:11:46 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-06-19 11:07:54 +0200 |
commit | 63c0626cb2a0bcfb37f903b98cf7975797186aca (patch) | |
tree | da16ad4c97d61e8d084a135767b3fcf955069d74 /id/server | |
parent | c393a871d38abe1638addd106258d8211eaa6a92 (diff) | |
download | moa-id-spss-63c0626cb2a0bcfb37f903b98cf7975797186aca.tar.gz moa-id-spss-63c0626cb2a0bcfb37f903b98cf7975797186aca.tar.bz2 moa-id-spss-63c0626cb2a0bcfb37f903b98cf7975797186aca.zip |
add JSON annotations, remove unnecessary cast
Diffstat (limited to 'id/server')
-rw-r--r-- | id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java index 63c3b5bfb..d657ed16a 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java @@ -14,6 +14,8 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +import com.fasterxml.jackson.annotation.JsonProperty; + public class ConfigurationFromDBExtractor { private ConfigurationFromDBExtractor() { @@ -24,7 +26,7 @@ public class ConfigurationFromDBExtractor { EntityManager session = ConfigurationDBUtils.getCurrentSession(); TypedQuery<T> query = session.createQuery(queryString, clazz); try { - result = clazz.cast(query.getSingleResult()); + result = query.getSingleResult(); } catch (Exception e) { return null; } @@ -43,38 +45,47 @@ public class ConfigurationFromDBExtractor { return result; } + @JsonProperty("getAuthComponentGeneral") public static AuthComponentGeneral getAuthComponentGeneral() { return getSingleValue("from AuthComponentGeneral", AuthComponentGeneral.class); } + @JsonProperty("getChainingModes") public static ChainingModes getChainingModes() { return (ChainingModes) getSingleValue("from ChainingModes", ChainingModes.class); } + @JsonProperty("getOnlineApplications") public static List<OnlineApplication> getOnlineApplications() { return getListOfValues("from OnlineApplication", OnlineApplication.class); } + @JsonProperty("getGenericConfigurations") public static List<GenericConfiguration> getGenericConfigurations() { return getListOfValues("from GenericConfiguration", GenericConfiguration.class); } + @JsonProperty("getTrustedCACertificates") public static String getTrustedCACertificates() { return getSingleValue("select trustedCACertificates from MOAIDConfiguration", String.class); } + @JsonProperty("getDefaultBKUs") public static DefaultBKUs getDefaultBKUs() { return getSingleValue("select defaultBKUs from MOAIDConfiguration", DefaultBKUs.class); } + @JsonProperty("getSLRequestTemplates") public static SLRequestTemplates getSLRequestTemplates() { return getSingleValue("select SLRequestTemplates from MOAIDConfiguration", SLRequestTemplates.class); } + @JsonProperty("getTimeStampItem") public static Date getTimeStampItem() { return getSingleValue("select timestampItem from MOAIDConfiguration", Date.class); } + @JsonProperty("getPvp2RefreshItem") public static Date getPvp2RefreshItem() { return getSingleValue("select pvp2RefreshItem from MOAIDConfiguration", Date.class); } |