ibatis传入表名查询
来源:互联网 发布:三亚克洛伊婚纱照 知乎 编辑:程序博客网 时间:2024/06/07 20:31
- public static void main(String[] args) {
- /*
- * Test test = new Test(); test.date = new
- * Timestamp(System.currentTimeMillis()); test.name = "fffff"; try {
- * long num = (Long) EntityManager.getSqlMapper().insertArgs(
- * "insertOperation", "fffff", new
- * Timestamp(System.currentTimeMillis())); logger.info("ID is " + num);
- * } catch (SQLException e) { e.printStackTrace(); }
- */
- // try the dynamic table dealation
- HashMap<String, Object> map = new HashMap<String, Object>();
- // set the query value
- map.put("ID", "dizhuang");
- // set the col1 to be selected
- map.put("col1", "*");
- // set the table name
- map.put("tablePrefix", "testsocevent");
- // set the col name which you use
- map.put("col2", "NAME");
- // map.put("ID", 1000);
- // map.put("id", "1005");
- try {
- // why args is error?
- Test test = (Test) EntityManager.getSqlMapper().queryForObject(
- "getTest", map);
- logger.info("id : " + test.id);
- logger.info("time :" + test.date);
- logger.info("name : " + test.name);
- } catch (SQLException e) {
- logger.error(e.getMessage(), e);
- // e.printStackTrace();
- }
- }
- // ibatis sql
- <select id="getTest" parameterClass="java.util.HashMap"
- resultClass="com.neusoft.soc.eventcenter.test.Test"
- remapResults="true">
- SELECT
- $col1$
- FROM
- $tablePrefix$
- WHERE
- $col2$ = #ID#
- </select>
0 1
- ibatis传入表名查询
- iBatis动态传入表名,字段名
- (总结)ibatis 动态传入表名和列名
- ibatis 动态传入 表名、列 以及参数
- 【MyBatis】myBatis动态传入表名、字段名(列名)进行查询
- mybatis 传入动态表名
- MyBatis,动态传入表名,字段名
- execute immediate 动态传入表名
- 间接实现动态传入表名
- 一个iBATIS的简单实现(含sql语句中表名等的动态传入)
- Ibatis传入数组参数
- ibatis传入list对象
- ibatis多表查询
- Ibatis多表查询
- Ibatis多表查询
- iBatis多表查询
- MyBatis,动态传入表名,字段名的解决办法
- MyBatis动态传入表名,字段名参数的解决办法
- 欢迎使用CSDN-markdown编辑器
- 1002. A+B for Polynomials (25)
- php获取某个日期0点的时间戳和24点时间戳的方法
- 一篇学会自定义组合控件
- 在localStorage中存储对象数组并读取
- ibatis传入表名查询
- js timestamp与datetime之间的相互转换
- hdu 4862 Jump 【最小费用最大流】好题
- iOS开发中,对请求数据出现<null>的一些简单处理
- Table './tsar/cpu_1' is marked as crashed and should be repaired
- 如何快速学习一门新技术
- 计算机常用英语词汇
- Windows下单机安装Spark开发环境
- 在lips追加拣配数量