美文网首页
hibernate from tuple 报错

hibernate from tuple 报错

作者: 风雨云 | 来源:发表于2018-11-22 09:01 被阅读0次

主要原因是jpa查询sql里返回字段为null,导致赋值失败,
import lombok.Data;

import java.io.Serializable;

@Data
public class ResAreaDTO implements Serializable {

private int id;

private String name;

private int parentId;

private byte level;

private Integer lock;

public ResAreaDTO(int id,String name,int parentId,byte level,Integer lock){
    this.id=id;
    this.name=name;
    this.parentId=parentId;
    this.level=level;
    this.lock=lock;
}
}  

可以把对应的类型,改成包装类型就可以了,比如lock参数类型。

相关文章

网友评论

      本文标题:hibernate from tuple 报错

      本文链接:https://www.haomeiwen.com/subject/itpcqqtx.html