摘要: 注意:使用的时候直接用user.getId如:int count = reportDAO.insert(user);此时count为插入条数,user.getId()为主键Xml代码insertintouser(userName,password,comment)values(#{userName},#{password},#{comment})如上所示,我们在insert中指定了keyProperty="userId",其中userId代表插入的User对象的主键属性。User.javaJava代码publicclassUser{privateintuserId;priv 阅读全文
posted @ 2013-12-16 17:21 prison 阅读(298) 评论(0) 推荐(0) 编辑