aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/resources/session.common.beans.xml
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main/resources/session.common.beans.xml')
-rw-r--r--id/server/idserverlib/src/main/resources/session.common.beans.xml27
1 files changed, 23 insertions, 4 deletions
diff --git a/id/server/idserverlib/src/main/resources/session.common.beans.xml b/id/server/idserverlib/src/main/resources/session.common.beans.xml
index 10c1320cc..defa47ec0 100644
--- a/id/server/idserverlib/src/main/resources/session.common.beans.xml
+++ b/id/server/idserverlib/src/main/resources/session.common.beans.xml
@@ -10,7 +10,8 @@
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:property-placeholder location="${moa.id.configuration}"/>
<context:annotation-config/>
<bean id="sessionDataSource" class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true" destroy-method="close">
@@ -32,9 +33,9 @@
<property name="validationQuery" value="${moasession.dbcp.validationQuery}" />
</bean>
- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
+ <bean id="sessionSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="sessionDataSource"/>
- <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db" />
+ <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.session" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${moasession.hibernate.dialect}</prop>
@@ -47,9 +48,27 @@
</property>
</bean>
+ <!-- MYSQL Conector -->
+ <tx:annotation-driven transaction-manager="sessionTransactionManager"/>
+
+ <bean id="sessionJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+ <property name="showSql" value="${moasession.hibernate.show_sql}" />
+ <property name="generateDdl" value="${moasession.jpaVendorAdapter.generateDdl}" />
+ <property name="databasePlatform" value="${moasession.hibernate.dialect}" />
+ </bean>
+
+ <bean name="session" id="session" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" depends-on="sessionDataSource">
+ <property name="dataSource" ref="sessionDataSource" />
+ <property name="jpaVendorAdapter" ref="sessionJpaVendorAdapter" />
+ <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.session" />
+ <property name="persistenceUnitName" value="session" />
+ </bean>
+
+ <bean name="sessionTransactionManager" id="sessionTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+ <property name="entityManagerFactory" ref="session" />
+ </bean>
<bean id="moaSessionDBUtils" class="at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils">
</bean>
-
</beans> \ No newline at end of file