Skip to content

ResultEntity 注解 VO映射

说明

ResultEntity 注解是VO类映射注解,它表达的VO内的字段 于 实体类之间的关系, 它可以自动继承实体类字段信息,例如 typeHandler,jdbcType等等

属性说明

属性是否可空默认值说明
value对应的实体类
storey1存储层级,联表自己join自己时使用,一般不用管

如何用?

java
@Data
@ResultEntity(SysUser.class)
public class SysUserVo {

    private Integer id;
    
    private String userName;

    private String password;
}
java
@Service
public class Test{

    @Autowired
    private SysUserMapper sysUserMapper;

    public void demo() {
        Pager<SysUserVo> pager = QueryChain.of(sysUserMapper)
                .select(SysUserVo.class)
                .eq(SysUser::getId,1)
                .like(SysUser::getUserName,"xxx")
                .returnType(SysUserVo.class)
                .paging(Pager.of(1,10));
    }
}