Преглед на файлове

set hibernate config use datasource

arkha преди 1 година
родител
ревизия
a25a099658

+ 5 - 24
MWUI/pom.xml

@@ -197,17 +197,17 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <version>3.3.2</version>
-        <!-- <configuration>
+        <configuration>
           <webResources>
             <resource>
-              <directory>src/main/webapp/WEB-INF/lib</directory>
+              <directory>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</directory>
               <targetPath>WEB-INF/lib</targetPath>
               <includes>
                 <include>*.license</include>
               </includes>
             </resource>
           </webResources>
-        </configuration> -->
+        </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -216,7 +216,7 @@
         <executions>
           <execution>
             <id>copy-my-license</id>
-            <phase>package</phase>
+            <phase>compile</phase>
             <goals>
               <goal>copy</goal>
             </goals>
@@ -247,6 +247,7 @@
         <artifactId>liberty-maven-plugin</artifactId>
         <version>3.11.1</version>
         <configuration>
+          <configDirectory>${project.basedir}/dev/config</configDirectory>
           <appsDirectory>apps</appsDirectory>
           <installAppPackages>project</installAppPackages>
         </configuration>
@@ -255,26 +256,6 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-resources-plugin</artifactId>
         <version>3.2.0</version>
-        <executions>
-          <execution>
-            <id>copy-my-license</id>
-            <phase>prepare-package</phase>
-            <goals>
-              <goal>copy-resources</goal>
-            </goals>
-            <configuration>
-              <outputDirectory>${project.build.directory}/liberty/wlp/usr/servers/defaultServer</outputDirectory>
-              <resources>
-                <resource>
-                  <directory>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</directory>
-                  <includes>
-                    <include>id.co.hanoman.btnmw.license</include>
-                  </includes>
-                </resource>
-              </resources>
-            </configuration>
-          </execution>
-        </executions>
       </plugin>
     </plugins>
   </build>

+ 11 - 40
MWUI/src/main/resources/db-config.xml

@@ -1,46 +1,17 @@
 <db-config>
-	<url>jdbc:db2://10.10.10.36:50000/mwconfig</url>
-	<driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
-	<username>db2inst1</username>
-	<password>wajFMo2HsNWsRQcLal8Y47jzNMHI+oAu8ywJwIfL9cA=</password>
-	<c3p0 id="jdbc:db2:">
-		<param id="minPoolSize">5</param>
-		<param id="maxPoolSize">50</param>
-		<param id="timeout">60</param>
-		<param id="idleConnectionTestPeriod">300</param>
-		<param id="maxIdleTime">300</param>
-		<param id="maxIdleTimeExcessConnections">180</param>
-		<param id="preferredTestQuery">select 1 from sysibm.sysdummy1</param>
-	</c3p0>
+	<datasource>jdbc/db2/mwconfig_mwconfig_ds</datasource>
 	<schema>mwconfig</schema>
 	<config-pattern>
 		<!-- If path is not specify, will be included to config -->
-		<!-- If path is specify, only using <include>will be included to config -->
-		<path id="config/clients/client">
-		</path>
-		<!-- <path id="config/codex">
-			<include>\[iso-8583-sms\]</include>
-			<include>\[iso-8583-itm\]</include>
-		</path> -->
-		<path id="config/db">
-		</path>
-		<path id="config/dbquery">
-		</path>
-		<!-- <path id="config/dtree-map">
-		</path> -->
-		<path id="config/host">
-		</path>
-		<path id="config/mapping">
-		</path>
-		<path id="config/param-map">
-		</path>
-		<path id="config/parser">
-		</path>
-		<path id="config/ports/port">
-		</path>
-		<path id="config/routing">
-		</path>
-		<path id="config/rpg-call">
-		</path>
+		<!-- If path is specify, only using <include> will be included to config -->
+		<path id="config/clients/client" />
+		<path id="config/db" />
+		<path id="config/dbquery" />
+		<path id="config/host" />
+		<path id="config/mapping" />
+		<path id="config/parser" />
+		<path id="config/ports/port" />
+		<path id="config/routing" />
+		<path id="config/rpg-call" />
 	</config-pattern>
 </db-config>

+ 1 - 73
MWUI/src/main/resources/hibernate-mwapp-config.cfg.xml

@@ -2,90 +2,18 @@
 <!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>
-		<!--property
-		name="dialect">org.hibernate.dialect.DB2Dialect</property>
-		<property name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property-->
-
-		<!-- udah dikomen -->
-		<!--property
-		name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property-->
-		<!-- <property name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property> -->
-
-		<!--property
-		name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
-		<property
-		name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
-
-		<prop key="hibernate.transaction.flush_before_completion">true</prop>
-		<prop key="hibernate.transaction.auto_close_session">true</prop>
-		<prop key="hibernate.cache.use_query_cache">false</prop>
-		<prop key="hibernate.cache.use_second_level_cache">false</prop>
-
-		<property name="jta.UserTransaction">java:comp/UserTransaction</property-->
-		<!-- <property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property> -->
-		<!--property
-		name="hibernate.connection.url">jdbc:db2://172.15.30.28:25010/MWAPP:currentSchema=MWAPP;</property-->
-		<property name="hibernate.connection.url">
-			jdbc:db2://10.10.10.36:50000/MWAPP:currentSchema=MWAPP;</property>
-		<property name="hibernate.connection.username">db2inst1</property>
-		<property name="hibernate.connection.password">mdw4dm1n</property>
 		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
-
+		<property name="hibernate.connection.datasource">jdbc/db2/mwapp_mwapp_ds</property>
 
 		<property name="hibernate.show_sql">false</property>
 		<property name="hibernate.format_sql">true</property>
 		<property name="hibernate.use_sql_comments">true</property>
 		<property name="hibernate.use_outer_join">true</property>
 
-		<!-- property name="hibernate.hbm2ddl.auto">create-drop</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">validate</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">update</property -->
-
-
-		<property name="hibernate.show_sql">false</property>
-		<property name="hibernate.format_sql">true</property>
-		<property name="hibernate.use_sql_comments">true</property>
-		<property name="hibernate.use_outer_join">true</property>
-
-		<!-- property name="hibernate.hbm2ddl.auto">create-drop</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">validate</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">update</property -->
-
 		<mapping resource="hbm/app/Attribute.hbm.xml" />
 		<mapping resource="hbm/app/EodConfig.hbm.xml" />
 		<mapping resource="hbm/app/Privilege.hbm.xml" />
 		<mapping resource="hbm/app/Role.hbm.xml" />
 		<mapping resource="hbm/app/SysParam.hbm.xml" />
-
-		<!--mapping
-		resource="hbm/ePayment/AppSetting.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhAppUser.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhAppUserAccount.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhBiller.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhBillerCategory.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhBillerConfig.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhBillerGroup.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhFilter.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhPrivilege.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhReport.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhRole.hbm.xml" />
-		<mapping resource="hbm/ePayment/NhServerConfig.hbm.xml" />
-
-		<mapping resource="hbm/rekon/CalendarDate.hbm.xml" />
-		<mapping resource="hbm/rekon/Channel.hbm.xml" />
-		<mapping resource="hbm/rekon/DataQuery.hbm.xml" />
-		<mapping resource="hbm/rekon/DbConnection.hbm.xml" />
-		<mapping resource="hbm/rekon/FileDb.hbm.xml" />
-		<mapping resource="hbm/rekon/FormatInfo.hbm.xml" />
-		<mapping resource="hbm/rekon/PrintDetail.hbm.xml" />
-		<mapping resource="hbm/rekon/PrintText.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconAction.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconCompare.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconFtp.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconJoin.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconProcess.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconSchedule.hbm.xml" />
-		<mapping resource="hbm/rekon/TableHeader.hbm.xml" />
-		<mapping resource="hbm/rekon/UpdateDb.hbm.xml" /-->
 	</session-factory>
 </hibernate-configuration>

+ 2 - 61
MWUI/src/main/resources/hibernate-mwapp.cfg.xml

@@ -1,56 +1,15 @@
 <?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>
-		<!--property
-		name="dialect">org.hibernate.dialect.DB2Dialect</property>
-		<property name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property-->
-
-		<!-- udah dikomen -->
-		<!--property
-		name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property-->
-		<!-- <property name="hibernate.connection.datasource">jdbc/db2/mwapp_mwui_ds</property> -->
-
-		<!--property
-		name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
-		<property
-		name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
-
-		<prop key="hibernate.transaction.flush_before_completion">true</prop>
-		<prop key="hibernate.transaction.auto_close_session">true</prop>
-		<prop key="hibernate.cache.use_query_cache">false</prop>
-		<prop key="hibernate.cache.use_second_level_cache">false</prop>
-
-		<property name="jta.UserTransaction">java:comp/UserTransaction</property-->
-		<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
-		<!--property
-		name="hibernate.connection.url">jdbc:db2://172.15.30.28:25010/MWAPP:currentSchema=MWBP;</property-->
-		<property name="hibernate.connection.url">
-			jdbc:db2://10.10.10.36:50000/MWAPP:currentSchema=MWBP;</property>
-
-		<property name="hibernate.connection.username">db2inst1</property>
-		<property name="hibernate.connection.password">mdw4dm1n</property>
-		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
-
+		<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
+		<property name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property>
 
 		<property name="hibernate.show_sql">false</property>
 		<property name="hibernate.format_sql">true</property>
 		<property name="hibernate.use_sql_comments">true</property>
 		<property name="hibernate.use_outer_join">true</property>
 
-		<!-- property name="hibernate.hbm2ddl.auto">create-drop</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">validate</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">update</property -->
-
-
-		<!--mapping
-		resource="hbm/app/Attribute.hbm.xml" />
-		<mapping resource="hbm/app/EodConfig.hbm.xml" />
-		<mapping resource="hbm/app/Privilege.hbm.xml" />
-		<mapping resource="hbm/app/Role.hbm.xml" />
-		<mapping resource="hbm/app/SysParam.hbm.xml" /-->
-
 		<mapping resource="hbm/ePayment/AppSetting.hbm.xml" />
 		<mapping resource="hbm/ePayment/NhAppUser.hbm.xml" />
 		<mapping resource="hbm/ePayment/NhAppUserAccount.hbm.xml" />
@@ -63,23 +22,5 @@
 		<mapping resource="hbm/ePayment/NhReport.hbm.xml" />
 		<mapping resource="hbm/ePayment/NhRole.hbm.xml" />
 		<mapping resource="hbm/ePayment/NhServerConfig.hbm.xml" />
-
-		<!--mapping
-		resource="hbm/rekon/CalendarDate.hbm.xml" />
-		<mapping resource="hbm/rekon/Channel.hbm.xml" />
-		<mapping resource="hbm/rekon/DataQuery.hbm.xml" />
-		<mapping resource="hbm/rekon/DbConnection.hbm.xml" />
-		<mapping resource="hbm/rekon/FileDb.hbm.xml" />
-		<mapping resource="hbm/rekon/FormatInfo.hbm.xml" />
-		<mapping resource="hbm/rekon/PrintDetail.hbm.xml" />
-		<mapping resource="hbm/rekon/PrintText.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconAction.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconCompare.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconFtp.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconJoin.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconProcess.hbm.xml" />
-		<mapping resource="hbm/rekon/ReconSchedule.hbm.xml" />
-		<mapping resource="hbm/rekon/TableHeader.hbm.xml" />
-		<mapping resource="hbm/rekon/UpdateDb.hbm.xml" /-->
 	</session-factory>
 </hibernate-configuration>

+ 1 - 34
MWUI/src/main/resources/hibernate-mwconfig.cfg.xml

@@ -1,37 +1,8 @@
 <?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>
-		<!--property
-		name="dialect">org.hibernate.dialect.DB2Dialect</property>
-		<property name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property-->
-
-		<!-- udah dikomen -->
-		<!-- <property
-			name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property> -->
-
-		<!--property
-		name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
-		<property
-		name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
-
-		<prop key="hibernate.transaction.flush_before_completion">true</prop>
-		<prop key="hibernate.transaction.auto_close_session">true</prop>
-		<prop key="hibernate.cache.use_query_cache">false</prop>
-		<prop key="hibernate.cache.use_second_level_cache">false</prop>
-
-		<property name="jta.UserTransaction">java:comp/UserTransaction</property-->
-		<!-- <property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property> -->
-		<!--property
-		name="hibernate.connection.url">jdbc:db2://172.15.30.28:25010/MWCONFIG:currentSchema=MWCONFIG;</property-->
-		<property
-			name="hibernate.connection.url">
-			jdbc:db2://10.10.10.36:50000/MWCONFIG:currentSchema=MWCONFIG;</property>
-
-		<property name="hibernate.connection.username">db2inst1</property>
-		<property name="hibernate.connection.password">mdw4dm1n</property>
+		<property name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwconfig_ds</property>
 		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
 
 		<property name="hibernate.show_sql">false</property>
@@ -39,10 +10,6 @@
 		<property name="hibernate.use_sql_comments">true</property>
 		<property name="hibernate.use_outer_join">true</property>
 
-		<!-- property name="hibernate.hbm2ddl.auto">create-drop</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">validate</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">update</property -->
-
 		<mapping resource="hbm/config/Adaptor.hbm.xml" />
 		<mapping resource="hbm/config/AdaptorCodex.hbm.xml" />
 		<mapping resource="hbm/config/AdaptorParam.hbm.xml" />

+ 1 - 28
MWUI/src/main/resources/hibernate-mwlog.cfg.xml

@@ -1,31 +1,8 @@
 <?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>
-		<!--property
-		name="dialect">org.hibernate.dialect.DB2Dialect</property>
-		<property name="hibernate.connection.datasource">jdbc/db2/mwlog_mwui_ds</property>
-		<property
-		name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
-		<property
-		name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
-
-		<prop key="hibernate.transaction.flush_before_completion">true</prop>
-		<prop key="hibernate.transaction.auto_close_session">true</prop>
-		<prop key="hibernate.cache.use_query_cache">false</prop>
-		<prop key="hibernate.cache.use_second_level_cache">false</prop>
-
-		<property name="jta.UserTransaction">java:comp/UserTransaction</property-->
-
-		<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
-		<!--property
-		name="hibernate.connection.url">jdbc:db2://172.15.30.28:25010/MWLOG:currentSchema=MWLOG;</property-->
-		<property name="hibernate.connection.url">
-			jdbc:db2://10.10.10.36:50000/MWLOG:currentSchema=MWLOG;</property>
-
-		<property name="hibernate.connection.username">db2inst1</property>
-		<property name="hibernate.connection.password">mdw4dm1n</property>
+		<property name="hibernate.connection.datasource">jdbc/db2/mwlog_mwlog_ds</property>
 		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
 
 		<property name="hibernate.show_sql">false</property>
@@ -33,10 +10,6 @@
 		<property name="hibernate.use_sql_comments">true</property>
 		<property name="hibernate.use_outer_join">true</property>
 
-		<!-- property name="hibernate.hbm2ddl.auto">create-drop</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">validate</property -->
-		<!-- property name="hibernate.hbm2ddl.auto">update</property -->
-
 		<mapping resource="hbm/log/Dlog.hbm.xml" />
 		<mapping resource="hbm/log/DlogList.hbm.xml" />
 		<mapping resource="hbm/log/DlogMd.hbm.xml" />