aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/moa-id-commons/src/main/resources')
-rw-r--r--id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml24
-rw-r--r--id/server/moa-id-commons/src/main/resources/configuration.beans.xml1
-rw-r--r--id/server/moa-id-commons/src/main/resources/hibernate_moasession.cfg.xml15
-rw-r--r--id/server/moa-id-commons/src/main/resources/hibernate_statistic.cfg.xml11
-rw-r--r--id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml75
5 files changed, 76 insertions, 50 deletions
diff --git a/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml b/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml
deleted file mode 100644
index 5c1558507..000000000
--- a/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
-http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
- version="2.0">
-
- <persistence-unit name="config" transaction-type="RESOURCE_LOCAL">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <class>at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty</class>
- <!-- <class>at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase</class> -->
- <properties>
- </properties>
- </persistence-unit>
-
- <persistence-unit name="session" transaction-type="RESOURCE_LOCAL">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <class>at.gv.egovernment.moa.id.commons.db.dao.session.AssertionStore</class>
- <!-- <class>at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase</class> -->
- <properties>
- </properties>
- </persistence-unit>
-
-</persistence> \ No newline at end of file
diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml
index 4d3caea8c..b97b1c88b 100644
--- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml
+++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml
@@ -17,6 +17,7 @@
<bean id="moaidconfig" class="at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfigurationImpl" />
<bean name="config" id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.config" />
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
<property name="persistenceUnitName" value="config" />
diff --git a/id/server/moa-id-commons/src/main/resources/hibernate_moasession.cfg.xml b/id/server/moa-id-commons/src/main/resources/hibernate_moasession.cfg.xml
deleted file mode 100644
index e40c8b8a9..000000000
--- a/id/server/moa-id-commons/src/main/resources/hibernate_moasession.cfg.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
- <!-- MOA Session handling mapping files -->
- <mapping class="at.gv.egovernment.moa.id.commons.db.dao.session.AssertionStore"/>
- <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
diff --git a/id/server/moa-id-commons/src/main/resources/hibernate_statistic.cfg.xml b/id/server/moa-id-commons/src/main/resources/hibernate_statistic.cfg.xml
deleted file mode 100644
index aa77a9c67..000000000
--- a/id/server/moa-id-commons/src/main/resources/hibernate_statistic.cfg.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
- <!-- MOA advanced statistic handling mapping files -->
- <mapping class="at.gv.egovernment.moa.id.commons.db.dao.statistic.StatisticLog"/>
- </session-factory>
-</hibernate-configuration> \ No newline at end of file
diff --git a/id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml b/id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml
new file mode 100644
index 000000000..5f80c6439
--- /dev/null
+++ b/id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans profile="advancedLogOn"
+ xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:p="http://www.springframework.org/schema/p"
+ xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
+
+ <context:annotation-config></context:annotation-config>
+ <tx:annotation-driven transaction-manager="statisticLogTransactionManager"/>
+
+ <bean id="statisticLogDataSource" class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true" destroy-method="close">
+ <aop:scoped-proxy/>
+ <property name="driverClassName" value="${advancedlogging.hibernate.connection.driver_class}" />
+ <property name="url" value="${advancedlogging.hibernate.connection.url}"/>
+ <property name="username" value="${advancedlogging.hibernate.connection.username}" />
+ <property name="password" value="${advancedlogging.hibernate.connection.password}" />
+
+ <property name="connectionProperties" value="${advancedlogging.dbcp.connectionProperties}" />
+ <property name="initialSize" value="${advancedlogging.dbcp.initialSize}" />
+ <property name="maxTotal" value="${advancedlogging.dbcp.maxActive}" />
+ <property name="maxIdle" value="${advancedlogging.dbcp.maxIdle}" />
+ <property name="minIdle" value="${advancedlogging.dbcp.minIdle}" />
+ <!-- property name="maxWait" value="${moasession.dbcp.maxWaitMillis}" / -->
+ <property name="testOnBorrow" value="${advancedlogging.dbcp.testOnBorrow}" />
+ <property name="testOnReturn" value="${advancedlogging.dbcp.testOnReturn}" />
+ <property name="testWhileIdle" value="${advancedlogging.dbcp.testWhileIdle}" />
+ <property name="validationQuery" value="${advancedlogging.dbcp.validationQuery}" />
+ </bean>
+
+ <bean id="statisticLogSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
+ <property name="dataSource" ref="statisticLogDataSource"/>
+ <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.statistic" />
+ <property name="hibernateProperties">
+
+ <props>
+ <prop key="hibernate.dialect">${advancedlogging.hibernate.dialect}</prop>
+ <prop key="hibernate.show_sql">${advancedlogging.hibernate.show_sql}</prop>
+ <prop key="hibernate.hbm2ddl.auto">${advancedlogging.hibernate.hbm2ddl.auto}</prop>
+ <prop key="current_session_context_class">${advancedlogging.hibernate.current_session_context_class}</prop>
+ <prop key="hibernate.transaction.flush_before_completion">${advancedlogging.hibernate.transaction.flush_before_completion}</prop>
+ <prop key="hibernate.transaction.auto_close_session">${advancedlogging.hibernate.transaction.auto_close_session}</prop>
+ </props>
+ </property>
+ </bean>
+
+
+ <bean id="statisticLogDBUtils" class="at.gv.egovernment.moa.id.commons.db.StatisticLogDBUtils">
+ </bean>
+
+ <bean name="statisticLogTransactionManager" id="statisticLogTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+ <property name="entityManagerFactory" ref="statistic" />
+ </bean>
+
+ <bean id="statisticJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+ <property name="showSql" value="${advancedlogging.hibernate.show_sql}" />
+ <property name="generateDdl" value="${advancedlogging.jpaVendorAdapter.generateDdl}" />
+ <property name="databasePlatform" value="${advancedlogging.hibernate.dialect}" />
+ </bean>
+
+ <bean name="statistic" id="statistic" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <property name="dataSource" ref="statisticLogDataSource" />
+ <property name="jpaVendorAdapter" ref="statisticJpaVendorAdapter" />
+ <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.statistic" />
+ <property name="persistenceUnitName" value="statistic" />
+ </bean>
+
+
+
+</beans> \ No newline at end of file