Spring注解实体类中⾮数据库字段属性
今天要给⼀个实体类添加⼀个List集合属性!都很好>新鲜用语
private List<Reverts> childList = new ArrayList<Reverts>();2011广州中考英语
写完后get/t⽅法⼀写,启动就报错:
accompany过去式org.hibernate.MappingException: Could not determine type for: java.util.List, at table: T_REVERTS, for columns: [org.hibernate.mapping.Column(childList)
解决办法:在属性的get⽅法上加上⼀段注解标识它是临时属性,不是数据库字段就OK
sanitation@Transient
public List<Reverts> getChildList() {
return childList;
we remain
伯利兹英语>广西会计从业资格考试试题}
orbispublic void tChildList(List<Reverts> childList) {
this.childList = childList;version什么意思
}
记得导⼊的是: import javax.persistence.Transient;