您的位置:首页 > 博客中心 > 数据库 >

Spring 注解实体类中非数据库字段属性

时间:2022-03-14 17:30

解决办法:在属性的get方法上加上一段注解标识它是临时属性,不是数据库字段就OK
@Transient
public List<Reverts> getChildList() {
return childList;
}
public void setChildList(List<Reverts> childList) {
this.childList = childList;
}

记得导入的是:import javax.persistence.Transient;

 

本类排行

今日推荐

热门手游