mybatis-flex / mybatis-flex

mybatis-flex is an elegant Mybatis Enhancement Framework

Home Page:https://mybatis-flex.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vo内有两个一样的字段,只会给一个赋值,另外一个为空

RedCarl opened this issue · comments

commented

this.mapper.paginateAs(
dto.getCurrent(),
dto.getPageSize(),
queryWrapper,
ApplyVo.class
);
我的场景是在ApplyVo中需要存在 userId 和 user
userId是普通id
user是用户实体信息

/**
 * 用户编号
 */
@ApiModelProperty("用户编号")
private Long userId;

/**
 * 用户信息
 */
@ApiModelProperty("用户信息")
@Column(value = "user_id", typeHandler = UserVoHandler.class)
private UserVo user;

这样子写的话 user 就有数据,但是 userId 没有,如果不写 value 的话,userId就有数据 user 没有。
有没有办法让 userId 和 user 也能获取到 user_id

commented

是否考虑可以手动写个getter