随笔分类 - 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
阅读全文
摘要:<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
阅读全文
摘要:Type interface com.zhaoka.mapper.DatKcardKmMapper is not known to the MapperRegistry 没有在sqlConfig.xml中配置对应mapper.xml文件
阅读全文
摘要:updateByPrimaryKey 除主键外,将所有属性更新到数据库。
阅读全文
摘要:用mybatis自动生成的mapper配置文件,insert方法没有主键值。所以主键如果不是自增类型,执行insert时因主键不能为空,会发生异常。
阅读全文
摘要:数据库中有project表,使用ibatis的根据id获取查询数据时,如果数据没有查询到。则返回的Project.java对象为null
阅读全文

浙公网安备 33010602011771号