DataSource增加getType()方法

This commit is contained in:
Redkale
2017-11-29 12:01:42 +08:00
parent 65bc8192f0
commit 043b847f05
2 changed files with 20 additions and 0 deletions

View File

@@ -64,6 +64,11 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
protected void preConstruct(String unitName, Properties readprop, Properties writeprop) {
}
@Override
public String getType() {
return "jdbc";
}
@Override
public final String resourceName() {
return name;
@@ -75,6 +80,14 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
writePool.close();
}
public PoolJdbcSource getReadPoolJdbcSource() {
return readPool;
}
public PoolJdbcSource getWritePoolJdbcSource() {
return writePool;
}
public Connection createReadSQLConnection() {
return readPool.poll();
}

View File

@@ -24,6 +24,13 @@ import org.redkale.util.*;
@SuppressWarnings("unchecked")
public interface DataSource {
/**
* 获取数据源类型
*
* @return String
*/
public String getType();
//----------------------insertAsync-----------------------------
/**
* 新增记录, 多对象必须是同一个Entity类 <br>