//连接信息 test.jdbcUrl = jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useOldAliasMetadataBehavior=true test.user = root test.password = qwert12345
//使用插件 C3p0Plugin cp = new C3p0Plugin(PropKit.get("test.jdbcUrl"),PropKit.get("test.user"), PropKit.get("test.password")); me.add(cp); ActiveRecordPlugin arp = new ActiveRecordPlugin("test",cp); arp.getEngine().setSourceFactory(new ClassPathSourceFactory()); _MappingKit.mapping(arp); me.add(arp);
//操作 if("0".equals(ocnObj.get("id").toString())){//新增 ui.setID(UUID.randomUUID().toString()); getModel(UiWorks.class)._setAttrs(ui).save(); }else{//修改 ui.setID(ocnObj.get("id").toString()); getModel(UiWorks.class)._setAttrs(ui).update(); }
项目:JFinal