76 lines
3.1 KiB
XML
76 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<beans 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"
|
|
xsi:schemaLocation="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.xsd
|
|
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
|
|
|
|
<context:property-placeholder
|
|
location="classpath*:jdbc.${spring.profiles.default}.properties" />
|
|
|
|
<tx:annotation-driven />
|
|
|
|
<bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig">
|
|
<property name="poolName" value="springHikariCP" />
|
|
<property name="dataSourceClassName" value="org.postgresql.ds.PGSimpleDataSource" />
|
|
<property name="connectionTimeout" value="3000" />
|
|
<property name="idleTimeout" value="90000" />
|
|
<property name="maximumPoolSize" value="${hikari.config.maximum.pool.size}" />
|
|
<property name="dataSourceProperties">
|
|
<props>
|
|
<prop key="serverName">${jdbc.serverName}</prop>
|
|
<prop key="databaseName">${jdbc.databaseName}</prop>
|
|
<prop key="user">${jdbc.username}</prop>
|
|
<prop key="password">${jdbc.password}</prop>
|
|
<prop key="portNumber">${jdbc.portNumber}</prop>
|
|
</props>
|
|
</property>
|
|
</bean>
|
|
|
|
<bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource">
|
|
<constructor-arg ref="hikariConfig" />
|
|
</bean>
|
|
|
|
<bean id="entityManagerFactory"
|
|
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
|
|
<property name="dataSource" ref="dataSource" />
|
|
<property name="packagesToScan" value="com.jasamedika.medifirst2000.entities" />
|
|
<property name="jpaVendorAdapter">
|
|
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
|
|
</property>
|
|
<property name="jpaProperties">
|
|
<props>
|
|
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
|
|
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
|
|
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
|
|
<prop key="javax.persistence.validation.mode">none</prop>
|
|
<prop key="hibernate.ejb.interceptor">
|
|
com.jasamedika.medifirst2000.logging.hibernate.interceptor.HibernateInterceptor
|
|
</prop>
|
|
</props>
|
|
</property>
|
|
<property name="jpaPropertyMap">
|
|
<map>
|
|
<entry key="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl}" />
|
|
</map>
|
|
</property>
|
|
</bean>
|
|
|
|
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
|
|
<property name="entityManagerFactory" ref="entityManagerFactory" />
|
|
</bean>
|
|
|
|
<bean id="persistenceExceptionTranslationPostProcessor"
|
|
class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
|
|
|
|
<bean id="messageSource"
|
|
class="org.springframework.context.support.ResourceBundleMessageSource">
|
|
<property name="basenames">
|
|
<list>
|
|
<value>messages</value>
|
|
</list>
|
|
</property>
|
|
</bean>
|
|
</beans>
|