DataSource增加getType()方法
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,13 @@ import org.redkale.util.*;
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface DataSource {
|
||||
|
||||
/**
|
||||
* 获取数据源类型
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getType();
|
||||
|
||||
//----------------------insertAsync-----------------------------
|
||||
/**
|
||||
* 新增记录, 多对象必须是同一个Entity类 <br>
|
||||
|
||||
Reference in New Issue
Block a user