use of com.qiuyj.mybatis.MapperSqlSource in project qiuyj-code by qiuyuanjun.
the class ReturnValueWrapper method generateSqlSource.
/**
* 生成对应的SqlSource,这里仅仅会生成DynamicSqlSource和StaticSqlSource
*/
public SqlSource generateSqlSource(Configuration configuration) {
if (Objects.isNull(sqlNode)) {
throw new IllegalArgumentException("SqlNode can not be null");
} else {
SqlSource sqlSource;
if (generateStaticSqlSource) {
DynamicContext context = new DynamicContext(configuration, null);
sqlNode.apply(context);
sqlSource = new StaticSqlSource(configuration, context.getSql(), parameterMappings);
} else {
sqlSource = new DynamicSqlSource(configuration, sqlNode);
}
return new MapperSqlSource(sqlSource);
}
}
Aggregations