use of com.github.pagehelper.BoundSqlInterceptorChain in project Mybatis-PageHelper by pagehelper.
the class PageBoundSqlInterceptors method setProperties.
public void setProperties(Properties properties) {
// 初始化 boundSqlInterceptorChain
String boundSqlInterceptorStr = properties.getProperty("boundSqlInterceptors");
if (StringUtil.isNotEmpty(boundSqlInterceptorStr)) {
String[] boundSqlInterceptors = boundSqlInterceptorStr.split("[;|,]");
List<BoundSqlInterceptor> list = new ArrayList<BoundSqlInterceptor>();
for (int i = 0; i < boundSqlInterceptors.length; i++) {
try {
list.add((BoundSqlInterceptor) Class.forName(boundSqlInterceptors[i]).newInstance());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
if (list.size() > 0) {
chain = new BoundSqlInterceptorChain(null, list);
}
}
}
Aggregations