Skip to content

Commit

Permalink
支持配置默认导入模块
Browse files Browse the repository at this point in the history
  • Loading branch information
javamxd committed Jul 26, 2020
1 parent 4c71e61 commit d4d11ce
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.ssssssss.magicapi.cache.SqlCache;
import org.ssssssss.magicapi.config.DynamicDataSource;
import org.ssssssss.magicapi.config.DynamicDataSource.DataSourceNode;
import org.ssssssss.magicapi.config.MagicModule;
import org.ssssssss.magicapi.dialect.Dialect;
import org.ssssssss.magicapi.dialect.DialectUtils;
import org.ssssssss.magicapi.exception.MagicAPIException;
Expand All @@ -24,7 +25,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;

public class DatabaseQuery extends HashMap<String, DatabaseQuery> {
public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements MagicModule {

@UnableCall
private DynamicDataSource dynamicDataSource;
Expand Down Expand Up @@ -287,6 +288,12 @@ public Object selectValue(String sql) {

private static GenericTokenParser ifParamTokenParser = new GenericTokenParser("?{", ",", true);

@UnableCall
@Override
public String getModuleName() {
return "db";
}

public static class BoundSql {
private String sql;
private List<Object> parameters = new ArrayList<>();
Expand Down

0 comments on commit d4d11ce

Please sign in to comment.