Commit 6b35dacd by s_guodong

修改运行时 支持dbReadset

parent 56dbb7be
......@@ -5,6 +5,7 @@ import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import com.brilliance.mda.runtime.mda.driver.MdaEnv;
import com.brilliance.mda.runtime.mda.impl.AbstractDaoSession;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.ModuleList;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.support.mybatis.count.CounterService;
import com.brilliance.mda.support.mybatis.dync.mapper.DbExecuteMapper;
......@@ -181,6 +182,11 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
}
@Override
public <T extends IModule> int dbReadset(ModuleList<T> list, CacheOption cacheOption, Argument... args) {
return dbReadset(list, args);
}
@Override
public <T extends IModule> int dbReadset(IModuleList<T> list, Argument... args) {
String moduleDB = MdaUtils.getModuleListDB(list);
DynamicDataSourceContextHolder.setDataSourceType(moduleDB);
......@@ -226,7 +232,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public List<String> dbColumnNames() {
if (resultLocal.get().hasNext()){
if (resultLocal.get().hasNext()) {
Map<String, Object> map = resultLocal.get().next();
List<String> columnNames = new ArrayList<>(map.keySet());
return columnNames;
......
package com.brilliance.mda.runtime.mda;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.ModuleList;
import java.util.List;
......@@ -23,20 +24,22 @@ public interface IDaoSession {
@SuppressWarnings("rawtypes")
<T extends IModule> int dbReadset(IModuleList<T> list,int limitSize, Argument... args);
<T extends IModule> int dbReadset(ModuleList<T> list, CacheOption cacheOption, Argument... args);
<T extends IModule> int dbReadset(IModuleList<T> list, String whereSql);
<T extends IModule> int dbReadset(IModuleList<T> list, String whereSql,Object[] params);
<T extends IModule> int dbReadset(IModuleList<T> list, String whereSql,String... params);
<T extends IModule> int dbReadset(IModuleList<T>[] lists, int maxSize, String whereClause, Object[] datas);
void dbReadset(IModuleList[] lists, String whereClause, Object[] datas);
void dbExecuteSQL(String sql,Object... params);
void dbFetchFields(IResult<? extends Object>... args);
void dbCloseCursor();
void putDao(Class<?> key, Object dao);
boolean isOpenTrans();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment