Update application context
Clean code
This commit is contained in:
parent
883e7712db
commit
2bd3622a0e
@ -7,19 +7,10 @@
|
||||
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
|
||||
|
||||
<context:annotation-config />
|
||||
|
||||
<context:component-scan base-package="com.jasamedika.medifirst2000"/>
|
||||
|
||||
<jpa:repositories base-package="com.jasamedika.medifirst2000.dao"
|
||||
entity-manager-factory-ref="entityManagerFactory" transaction-manager-ref="transactionManager" />
|
||||
|
||||
|
||||
|
||||
<!-- <bean id="facadeMonitoringAdvisor" class="net.bull.javamelody.MonitoringSpringAdvisor">
|
||||
<property name="pointcut">
|
||||
<bean class="net.bull.javamelody.MonitoredWithInterfacePointcut">
|
||||
<property name="interfaceName" value="com.jasamedika.medifirst2000.service.MonitoredService" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean> -->
|
||||
<context:component-scan base-package="com.jasamedika.medifirst2000" />
|
||||
|
||||
<jpa:repositories base-package="com.jasamedika.medifirst2000.dao"
|
||||
entity-manager-factory-ref="entityManagerFactory"
|
||||
transaction-manager-ref="transactionManager" />
|
||||
</beans>
|
||||
|
||||
@ -1,42 +1,22 @@
|
||||
<?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:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
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
|
||||
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
|
||||
|
||||
<!-- <context:property-placeholder
|
||||
location="
|
||||
classpath*:jdbc.testing.properties,
|
||||
classpath*:jdbc.logging.properties,
|
||||
classpath*:jdbc.${spring.profiles.default}.properties" /> -->
|
||||
|
||||
<context:property-placeholder
|
||||
location="classpath*:jdbc.${spring.profiles.default}.properties" />
|
||||
|
||||
<tx:annotation-driven transaction-manager="transactionManager" />
|
||||
|
||||
<!-- <bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
|
||||
<property name="baselineOnMigrate" value="true" /> <property name="locations"
|
||||
value="classpath:/db/migration" /> <property name="dataSource" ref="dataSource"
|
||||
/> </bean> -->
|
||||
|
||||
<!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
|
||||
primary="true" destroy-method="close" p:driverClassName="${jdbc.driver}"
|
||||
p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}"
|
||||
p:maxWait="40000" p:validation-query="select 1" p:test-on-borrow="true" p:maxActive="80"
|
||||
p:maxIdle="20" /> -->
|
||||
<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> <!-- add by iwankasan -->
|
||||
<property name="idleTimeout" value="90000" /> <!-- change by iwankasan -->
|
||||
<property name="maximumPoolSize" value="${hikari.config.maximum.pool.size}" /> <!-- add by iwankasan -->
|
||||
<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>
|
||||
@ -44,9 +24,6 @@
|
||||
<prop key="user">${jdbc.username}</prop>
|
||||
<prop key="password">${jdbc.password}</prop>
|
||||
<prop key="portNumber">${jdbc.portNumber}</prop>
|
||||
|
||||
<!-- <prop key="cachePrepStmts">true</prop> <prop key="prepStmtCacheSize">250</prop>
|
||||
<prop key="prepStmtCacheSqlLimit">2048</prop> <prop key="useServerPreStmts">true</prop> -->
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
@ -68,10 +45,9 @@
|
||||
<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>
|
||||
<!-- Interceptor, alter by Syamsu -->
|
||||
<prop key="hibernate.ejb.interceptor">com.jasamedika.medifirst2000.logging.hibernate.interceptor.HibernateInterceptor
|
||||
<prop key="hibernate.ejb.interceptor">
|
||||
com.jasamedika.medifirst2000.logging.hibernate.interceptor.HibernateInterceptor
|
||||
</prop>
|
||||
<!-- Interceptor, alter by Syamsu -->
|
||||
</props>
|
||||
</property>
|
||||
<property name="jpaPropertyMap">
|
||||
@ -85,43 +61,9 @@
|
||||
<property name="entityManagerFactory" ref="entityManagerFactory" />
|
||||
</bean>
|
||||
|
||||
<!-- DataSource object for logging purpose -->
|
||||
<!-- <bean id="loggingDataSource" class="org.apache.commons.dbcp.BasicDataSource"
|
||||
destroy-method="close" p:driverClassName="${jdbc.logging.driver}" p:url="${jdbc.logging.url}"
|
||||
p:username="${jdbc.logging.username}" p:password="${jdbc.logging.password}"
|
||||
p:maxWait="40000" p:maxActive="80" p:maxIdle="20" /> <bean id="loggingEntityManagerFactory"
|
||||
primary="false" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
|
||||
<property name="dataSource" ref="loggingDataSource" /> <property name="packagesToScan"
|
||||
value="com.jasamedika.medifirst2000.logging" /> <property name="jpaVendorAdapter">
|
||||
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
|
||||
/> </property> <property name="jpaProperties"> <props> <prop key="hibernate.hbm2ddl.auto">none</prop>
|
||||
<prop key="hibernate.format_sql">false</prop> <prop key="hibernate.show_sql">false</prop>
|
||||
<prop key="hibernate.dialect">${jdbc.logging.hibernate.dialect}</prop> </props>
|
||||
</property> </bean> <bean id="loggingTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
|
||||
<property name="entityManagerFactory" ref="loggingEntityManagerFactory" />
|
||||
</bean> -->
|
||||
|
||||
|
||||
<bean id="persistenceExceptionTranslationPostProcessor"
|
||||
class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
|
||||
|
||||
<!-- <jpa:repositories base-package="com.jasamedika.medifirst2000.dao" repository-impl-postfix="CustomImpl"
|
||||
/> <context:component-scan base-package="com.jasamedika.medifirst2000.service"
|
||||
/> -->
|
||||
|
||||
<!-- Hibernate Statistics Monitoring -->
|
||||
<!-- Publishing session factory to be able view statistics -->
|
||||
<!-- <bean id="sessionFactory" factory-bean="entityManagerFactory" factory-method="getSessionFactory"
|
||||
/> <bean id="hibernateStatisticsMBean" class="org.hibernate.jmx.StatisticsService">
|
||||
<property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="mbeanExporter"
|
||||
class="org.springframework.jmx.export.MBeanExporter"> <property name="beans">
|
||||
<map> <entry key="SpringBeans:name=hibernateStatisticsMBean" value-ref="hibernateStatisticsMBean"
|
||||
/> </map> </property> </bean> <context:mbean-server /> -->
|
||||
|
||||
<!-- <context:component-scan base-package="com.jasamedika.medifirst2000"
|
||||
/> -->
|
||||
|
||||
|
||||
<bean id="messageSource"
|
||||
class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="basenames">
|
||||
@ -130,11 +72,4 @@
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- enable aop -->
|
||||
<!-- <aop:aspectj-autoproxy /> <bean id="loggingAdvise" class="com.jasamedika.medifirst2000.logging.LoggingAdvise"
|
||||
/> -->
|
||||
|
||||
<!-- For Bean Spring Security -->
|
||||
<!-- <bean id="springSecurityFilterChain" class="org.springframework.web.filter.DelegatingFilterProxy"/> -->
|
||||
</beans>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user