use of org.beetl.sql.core.DefaultNameConversion in project nutzboot by nutzam.
the class BeetlSqlStarter method creatSQLManager.
@IocBean(name = "beetlsqlManager")
public SQLManager creatSQLManager(@Inject("refer:beetlsqlDBStyle") DBStyle dbStyle, @Inject("beetlsqlConnectionSource") ConnectionSource ds) {
// BeetlSql默认/sql/,但NutzBoot的约定是/sqls/,入乡随俗吧
SQLLoader loader = new ClasspathLoader(conf.get(PROP_PATH, "/sqls/"));
// TODO 支持更多种类的NameConversion
NameConversion nameconv = "default".equals(conf.get(PROP_NAME_CONVERSION, "default")) ? new DefaultNameConversion() : new UnderlinedNameConversion();
// 是否插入debug拦截器呢? 默认启用好了
if (conf.getBoolean(PROP_DEBUG, true))
return new SQLManager(dbStyle, loader, ds, nameconv, new Interceptor[] { new DebugInterceptor() });
return new SQLManager(dbStyle, loader, ds, nameconv);
}
Aggregations