Bean Searcher 发布 v3.1.3 版本
Bean Searcher 发布 v3.1.3版本,具体更新内容如下: Bean Searcher 无@DbIgnore也自动忽略实体类中的静态字段 Bean Searcher Boot Starter 使用 Searcher 类型注入检索器时,默认注入 MapSearcher,不再报错 提高兼容性,SpringBoot 最低版本支持到 v1.4+
经过了将近 4 个月,我终于又有了一点点闲置的时间,刚好趁这波机会 将项目进行了一次大升级,所以版本号也是飞跃式的上升,从1.1.17 直接升级到2.0。
Magician 除了底层大换血,全部改成了Netty,其他基本没变,只是少了一个UDP的支持,从使用者的角度来看 基本没啥变化
Magician-Web只是配合Magician进行的一次小小的调整,所以几乎没变化。
重点在Magician-JDBC
依然保留了多数据源的支持,其他变化如下
ParamPO paramPO = new ParamPO();
paramPO.setUserName("a");
paramPO.setUserEmail("test@qq.com");
int result = JDBCTemplate.get().insert("表名", paramPO);
// 构建修改条件
List<Condition> conditionList = new ArrayList<>();
conditionList.add(Condition.get("id = ?", 4));
// 构建修改数据
ParamPO paramPO = new ParamPO();
paramPO.setUserName("a");
paramPO.setUserEmail("test@qq.com");
// 执行修改
int result = JDBCTemplate.get().update("表名", paramPO, conditionList);
// 构建删除条件
List<Condition> conditionList = new ArrayList<>();
conditionList.add(Condition.get("id = ?", 42));
// 执行删除
int result = JDBCTemplate.get().delete("表名", conditionList);
// 构建查询条件
List<Condition> conditionList = new ArrayList<>();
conditionList.add(Condition.get("id > ?", 10));
conditionList.add(Condition.get("and user_name != ?", "a"));
conditionList.add(Condition.get("order by create_time desc", Condition.NOT_WHERE));
// 执行查询
List<ParamPO> result = JDBCTemplate.get().select("xt_message_board", conditionList, ParamPO.class);
ParamPO paramPO = new ParamPO();
paramPO.setUserName("testTx222");
paramPO.setUserEmail("testTx222@qq.com");
paramPO.setId(4);
// 采用{}占位符的写法
int result = JDBCTemplate.get().exec("update xt_message_board set user_name = {user_name} , user_email = {user_email} where id = {id}", paramPO);
// 采用 ? 占位符的写法
int result = JDBCTemplate.get().exec("update xt_message_board set user_name = ? , user_email = ? where id = ?", new Object[]{"testTx222","testTx222@qq.com", 4});
ParamPO paramPO = new ParamPO();
paramPO.setId(5);
paramPO.setUserName("a");
// 采用{}占位符的写法
List<ParamPO> result = JDBCTemplate.get("dataSource").selectList("select * from xt_message_board where id > {id} and user_name != {user_name}", paramPO, ParamPO.class);
// 采用 ? 占位符的写法
List<ParamPO> result = JDBCTemplate.get("dataSource").selectList("select * from xt_message_board where id > ? and user_name != ?", new Object[]{5, "a"}, ParamPO.class);
// 查询条件
ParamPO paramPO = new ParamPO();
paramPO.setId(5);
paramPO.setUserName("a");
// 查询参数
PageParamModel pageParamModel = new PageParamModel();
pageParamModel.setCurrentPage(1);
pageParamModel.setPageSize(10);
pageParamModel.setParam(paramPO);
// 使用默认countSql查询
PageModel<ParamPO> pageModel = JDBCTemplate.get().selectPage("select * from xt_message_board where id > {id} and user_name != {user_name}", pageParamModel, ParamPO.class);
// 使用自定义countSql查询
String countSql = "自己定义countSql";
PageModel<ParamPO> pageModel = JDBCTemplate.get().selectPageCustomCountSql("select * from xt_message_board where id > {id} and user_name != {user_name}", countSql, pageParamModel, ParamPO.class);
// 开启事务
TransactionManager.beginTraction();
try {
ParamPO paramPO = new ParamPO();
paramPO.setUserName("testTx222");
paramPO.setUserEmail("testTx222@qq.com");
paramPO.setId(4);
int result = JDBCTemplate.get().exec("update xt_message_board set user_name = {user_name} , user_email = {user_email} where id = {id}", paramPO);
// 提交
TransactionManager.commit();
} catch(Execption e){
// 回滚
TransactionManager.rollback();
}
微信关注我们
转载内容版权归作者及来源网站所有!
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。
马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。
为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。
Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。