建立实体类和数据库映射(注解)

匿名 (未验证) 提交于 2019-12-02 23:40:02
 1.建立实体类和数据库映射 		@Select("select * from user")     @Results(id = "resultMap",value = {             @Result(id = true,property = "userId",column ="id"),             @Result(property = "userName",column ="username"),             @Result(property = "userSex",column ="sex"),             @Result(property = "userAddress",column ="address"),     })     List<User> findAll();      2.其他mapper对其进行引用 		@Select("select * from user where id=#{id}")     @ResultMap(value={"resultMap"})     User getUserById(Integer id);

文章来源: https://blog.csdn.net/qq1424035130/article/details/91446286
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!