This commit is contained in:
@@ -52,12 +52,7 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
|||||||
protected final BiFunction<DataSource, Class, List> fullloader = (s, t) -> querySheet(false, false, t, null, null, (FilterNode) null).list(true);
|
protected final BiFunction<DataSource, Class, List> fullloader = (s, t) -> querySheet(false, false, t, null, null, (FilterNode) null).list(true);
|
||||||
|
|
||||||
public DataJdbcSource(String unitName, Properties readprop, Properties writeprop) {
|
public DataJdbcSource(String unitName, Properties readprop, Properties writeprop) {
|
||||||
this.preConstruct(unitName, readprop, writeprop);
|
this.initByProperties(unitName, readprop, writeprop);
|
||||||
this.name = unitName;
|
|
||||||
this.conf = null;
|
|
||||||
this.readPool = new PoolJdbcSource(this, "read", readprop);
|
|
||||||
this.writePool = new PoolJdbcSource(this, "write", writeprop);
|
|
||||||
this.cacheForbidden = "NONE".equalsIgnoreCase(readprop.getProperty(JDBC_CACHE_MODE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataJdbcSource() {
|
public DataJdbcSource() {
|
||||||
@@ -86,6 +81,11 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
|||||||
readprop.put(pn, pv);
|
readprop.put(pn, pv);
|
||||||
}
|
}
|
||||||
if (writeprop.isEmpty()) writeprop = readprop;
|
if (writeprop.isEmpty()) writeprop = readprop;
|
||||||
|
this.initByProperties(unitName, readprop, writeprop);
|
||||||
|
}
|
||||||
|
|
||||||
|
//构造前调用
|
||||||
|
protected void initByProperties(String unitName, Properties readprop, Properties writeprop) {
|
||||||
this.name = unitName;
|
this.name = unitName;
|
||||||
this.conf = null;
|
this.conf = null;
|
||||||
this.readPool = new PoolJdbcSource(this, "read", readprop);
|
this.readPool = new PoolJdbcSource(this, "read", readprop);
|
||||||
@@ -93,10 +93,6 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
|||||||
this.cacheForbidden = "NONE".equalsIgnoreCase(readprop.getProperty(JDBC_CACHE_MODE));
|
this.cacheForbidden = "NONE".equalsIgnoreCase(readprop.getProperty(JDBC_CACHE_MODE));
|
||||||
}
|
}
|
||||||
|
|
||||||
//构造前调用
|
|
||||||
protected void preConstruct(String unitName, Properties readprop, Properties writeprop) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Local
|
@Local
|
||||||
@Override
|
@Override
|
||||||
public String getType() {
|
public String getType() {
|
||||||
|
|||||||
Reference in New Issue
Block a user