多对一指的是在多的一端维护关联关系.用户、 组表创建对象用户是多的一段Group是一的一端 创建接口public interface UserDao { User getUserById(int uid);}sql 映射文件<?xml version="1.0" encoding=&qu……继续阅读 » 海叔叔 11个月前 (11-21) 17浏览 0评论0个赞
mybatis-plus自动填充学习使用mybatis-plus的自动填充功能,对create_time和update_time做一个自动填充,期间碰到了一些问题,记录一下问题和相关代码?在实体类字段上增加注解@TableField(fill = FieldFill.INSERT)[email protected](fill = FieldFill.UPDATE……继续阅读 » 海叔叔 12个月前 (11-11) 12浏览 0评论0个赞
Mybatis-plus – 分页 – RowBoundsServer [email protected]@[email protected] class AvatarServiceImpl implements AvatarService { @Autowired private AvatarDao ……继续阅读 » 海叔叔 12个月前 (11-04) 15浏览 0评论0个赞
使用resultType进行输出映射,只有查询出来的列名和pojo中的属性名一致,该列才可以映射成功。如果查询出来的列名和pojo的属性名不一致,通过定义一个resultMap对列名和pojo属性名之间作一个映射关系。resultMap:适合使用返回值是自定义实体类的情况resultType:适合使用返回值得数据类型是非自定义的,即jdk的提供的类型……继续阅读 » 海叔叔 1年前 (2021-10-29) 21浏览 0评论0个赞