- penambahan configuration file untuk development

This commit is contained in:
salmanoe 2021-01-07 12:33:25 +07:00
parent 001609fc4e
commit b5565a958b
2 changed files with 181 additions and 0 deletions

View File

@ -0,0 +1,136 @@
<?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"
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">
<context:property-placeholder
location="
classpath*:jdbc.testing.properties,
classpath*:jdbc.logging.properties,
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" /> -->
<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="5" /> <!-- add by iwankasan -->
<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="cachePrepStmts">true</prop> <prop key="prepStmtCacheSize">250</prop>
<prop key="prepStmtCacheSqlLimit">2048</prop> <prop key="useServerPreStmts">true</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">true</prop>
<prop key="hibernate.show_sql">true</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>
<!-- Interceptor, alter by Syamsu -->
</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>
<!-- 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">
<list>
<value>messages</value>
</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>

View File

@ -0,0 +1,45 @@
jdbc.driver = org.postgresql.Driver
hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
hibernate.hbm2ddl = none
# DB Production
jdbc.url = jdbc:postgresql://192.168.12.1:5432/rsab_hk_production
jdbc.username = postgres
jdbc.password = root
jdbc.serverName = 192.168.12.1
jdbc.databaseName = rsab_hk_production
jdbc.portNumber = 5432
# DB Mirroring
#jdbc.url = jdbc:postgresql://ds.rsabhk.lan:5432/rsab_hk_production
#jdbc.username = postgres
#jdbc.password = root
#jdbc.serverName = ds.rsabhk.lan
#jdbc.databaseName = rsab_hk_production
#jdbc.portNumber = 5432
# DB Development
#jdbc.url = jdbc:postgresql://192.168.12.3:5432/backup_7Des
#jdbc.username = postgres
#jdbc.password = root
#jdbc.serverName = 192.168.12.3
#jdbc.databaseName = backup_7Des
#jdbc.portNumber = 5432
# DB Localhost
#jdbc.url = jdbc:postgresql://172.16.111.13:5432/rsab_hk_backup
#jdbc.username = postgres
#jdbc.password = root
#jdbc.serverName = 172.16.111.13
#jdbc.databaseName = rsab_hk_backup
#jdbc.portNumber = 5432
#reportDirectory=C\:/harkit_report/
reportDirectory=/home/svradmin/app-back/uploadfile/
urlServiceSarPras=http://localhost:8888/jasamedika-web/
urlService=http://192.168.12.2/simrs_harkit/service/transaksi/
#jdbc.driver = com.mysql.jdbc.Driver
#jdbc.url = jdbc:mysql://172.16.16.1./medifirst2000?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull
#jdbc.username = root
#jdbc.password = adminmysql
#hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
#hibernate.hbm2ddl = update