|
@@ -1,12 +1,14 @@
|
|
package com.warewms.config;
|
|
package com.warewms.config;
|
|
|
|
|
|
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
|
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
|
|
|
+import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
|
|
import com.jfinal.template.source.ClassPathSourceFactory;
|
|
import com.jfinal.template.source.ClassPathSourceFactory;
|
|
import com.warewms.model._MappingKit;
|
|
import com.warewms.model._MappingKit;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
import javax.sql.DataSource;
|
|
import javax.sql.DataSource;
|
|
|
|
|
|
@Component
|
|
@Component
|
|
@@ -16,8 +18,14 @@ public class ActiveRecordConfig {
|
|
@Autowired
|
|
@Autowired
|
|
private DataSource ds;
|
|
private DataSource ds;
|
|
|
|
|
|
-// @Resource(name = "secondDataSource")
|
|
|
|
-// private DataSource dsSecond;
|
|
|
|
|
|
+ @Resource(name = "secondDataSource")
|
|
|
|
+ private DataSource dsSecond;
|
|
|
|
+
|
|
|
|
+ @Resource(name = "thirdDataSource")
|
|
|
|
+ private DataSource dsThird;
|
|
|
|
+
|
|
|
|
+ @Resource(name = "fourthDataSource")
|
|
|
|
+ private DataSource dsFourth;
|
|
|
|
|
|
@Bean(initMethod="start", destroyMethod="stop",name = "activeRecordPlugin")
|
|
@Bean(initMethod="start", destroyMethod="stop",name = "activeRecordPlugin")
|
|
public ActiveRecordPlugin init() {
|
|
public ActiveRecordPlugin init() {
|
|
@@ -29,13 +37,13 @@ public class ActiveRecordConfig {
|
|
return arp;
|
|
return arp;
|
|
}
|
|
}
|
|
|
|
|
|
-// @Bean(initMethod="start", destroyMethod="stop",name = "msSqlRecord")
|
|
|
|
-// public ActiveRecordPlugin initMsSql() {
|
|
|
|
-// ActiveRecordPlugin arp = new ActiveRecordPlugin("sqlServer",dsSecond);
|
|
|
|
-// arp.getEngine().setSourceFactory(new ClassPathSourceFactory());
|
|
|
|
-// arp.setShowSql(false);
|
|
|
|
-// arp.setDialect(new SqlServerDialect());
|
|
|
|
-// //arp.addMapping("T_SHKD_CUSTOMER", TShkdCustomer.class);
|
|
|
|
-// return arp;
|
|
|
|
-// }
|
|
|
|
|
|
+ @Bean(initMethod="start", destroyMethod="stop",name = "msSqlRecord")
|
|
|
|
+ public ActiveRecordPlugin initMsSql() {
|
|
|
|
+ ActiveRecordPlugin arp = new ActiveRecordPlugin(dsSecond);
|
|
|
|
+ arp.getEngine().setSourceFactory(new ClassPathSourceFactory());
|
|
|
|
+ arp.setShowSql(false);
|
|
|
|
+ arp.setDialect(new MysqlDialect());
|
|
|
|
+// arp.addMapping("T_SHKD_CUSTOMER", TShkdCustomer.class);
|
|
|
|
+ return arp;
|
|
|
|
+ }
|
|
}
|
|
}
|