ibaits事务
来源:互联网 发布:linux安装 编辑:程序博客网 时间:2024/05/01 07:25
SqlMapClient sqlMapper = getSqlMap.getSqlMapClient();
sqlMapper.startTransaction();
sqlMapper.insert("CopyHtxx", h);
sqlMapper.insert("InsertJournal", journal);
sqlMapper.insert("InsertHtrz", rz);
sqlMapper.commitTransaction();
sqlMapper.endTransaction();
分页
public static PageInfo queryForPageInfo(String MapName,Object obj){String pagingMapName=MapName+"Paging";String countMapName=MapName+"Count"; SqlMapClient sqlMapper=getSqlMap.getSqlMapClient(); PageInfo pageInfo=new PageInfo(); try { List list=sqlMapper.queryForList(pagingMapName, obj); pageInfo.setRoot(list); int count=Integer.valueOf(sqlMapper.queryForObject(countMapName,obj).toString()); pageInfo.setTotalCount(count);} catch (SQLException e1) {// TODO Auto-generated catch blocke1.printStackTrace();}return pageInfo;}
public class PageInfo {private int totalCount;private List root;public List getRoot() {return root;}public void setRoot(List root) {this.root = root;}public int getTotalCount() {return totalCount;}public void setTotalCount(int totalCount) {this.totalCount = totalCount;}}
public static JSONObject pageInfoToJson(PageInfo pageInfo){JsonConfig cfg=new JsonConfig();cfg.registerJsonValueProcessor(java.util.Date.class, new JsonValueProcessorImpl());JSONObject json = JSONObject.fromObject(pageInfo,cfg);return json;}
PageInfo pi = MgrHtgl.select(t);JSONObject json = IbatisBaseDb.pageInfoToJson(pi);if(pi.getTotalCount()>0){Htxx1 sum = MgrHtgl.selectAllHtxxSum(t);json.put("sum", sum);}JsonUtil.outJson(response,json);
- ibaits事务
- ibaits 标签
- ibaits入门
- ibaits试题
- iBaits学习2
- ibaits 的优缺点对比
- Ibaits初学入门
- Ibaits输出sql语句
- ibaits工具类
- ibaits 详细介绍
- Spring整合Ibaits
- ibaits动态查询
- ibaits防止注入
- ibaits入门demo
- 关于iBaits的使用
- Ibaits调用存储过程
- Ibaits增量更新
- mybaits/ibaits注意点
- 黑马程序员 Socket网络编程--聊天室
- Google Hacking的实现以及应用
- 本人个人博客只维护Farbox个人博客,CSDN博客停止同步更新
- 佛說八大人覺經
- System.gc()
- ibaits事务
- 起薪8000年终40万 游戏行业人才缺口达60万
- python 全排列的实现
- linux 下结合find 和 rm 删除大量文件 【转发博文】
- XML JAXB样例
- 生活有载(一)
- ubuntu在命令行下同步时间
- Redis常用命令
- U盘量产的作用