随笔分类 -  ibatis

摘要:①selectByPrimaryKey()User user = userDAO.selectByPrimaryKey(100); 相当于select * from user where id = 100②selectByExample() 和selectByExampleWithBLOGs()UserExample example =newUserExample();Criteriacriteria = example.createCriteria();criteria.andUsernameEqualTo("joe");criteria.andUsernameIsNul 阅读全文
posted @ 2012-05-15 21:21 刘振明 阅读(1515) 评论(2) 推荐(0)
摘要:<insert id="add" parameterType="vo.Category"><selectKey resultType="java.lang.Short" order="AFTER" keyProperty="id">SELECT LAST_INSERT_ID()</selectKey>insert into category (name_zh, parent_id,show_order, delete_status, description)v 阅读全文
posted @ 2012-03-21 15:37 刘振明 阅读(15526) 评论(0) 推荐(0)
摘要:Type interface com.zhaoka.mapper.DatKcardKmMapper is not known to the MapperRegistry 没有在sqlConfig.xml中配置对应mapper.xml文件 阅读全文
posted @ 2012-03-08 14:24 刘振明 阅读(14416) 评论(2) 推荐(2)
摘要:updateByPrimaryKey 除主键外,将所有属性更新到数据库。 阅读全文
posted @ 2012-03-06 09:56 刘振明 阅读(523) 评论(0) 推荐(0)
摘要:用mybatis自动生成的mapper配置文件,insert方法没有主键值。所以主键如果不是自增类型,执行insert时因主键不能为空,会发生异常。 阅读全文
posted @ 2012-03-06 09:38 刘振明 阅读(3400) 评论(0) 推荐(0)
摘要:数据库中有project表,使用ibatis的根据id获取查询数据时,如果数据没有查询到。则返回的Project.java对象为null 阅读全文
posted @ 2012-02-27 10:22 刘振明 阅读(640) 评论(0) 推荐(0)