前景提要
HDC调试需求开发(15万预算),能者速来!>>>
1.configPlugin DruidPlugin druidPlugin = new DruidPlugin(getProperty("jdbcUrl"), getProperty("user"), getProperty("password")); druidPlugin.setFilters("stat,log4j"); me.add(druidPlugin); me.add(new EhCachePlugin()); // 配置ActiveRecord插件 AutoTableBindPlugin arp = new AutoTableBindPlugin(druidPlugin,TableNameStyle.LOWER);//table是实体的小写 me.add(arp); arp.setShowSql(true);
2.实体类 @TableBind(tableName="table") public class table extends Model<table>{ private static final long serialVersionUID = 1L; public static String tableName = "table"; public static final AdminUser table = new table(); public AdminUser getByName(String username){ return dao.findFirst("select * from table where username=" + username); }
3.报错: java.lang.NullPointerException at com.jfinal.plugin.activerecord.Model.find(Model.java:529) at com.jfinal.plugin.activerecord.Model.findFrist(Model.java:546)