1.异常描述
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: cn.itcast.entity.Customer column: custLevel (should be mapped with insert=“false” update=“false”)
2.实体类和映射文件的对应
2-1.实体类
public class Customer {
private Integer cid;
private String custName;
private String custLevel;
private String custSource;
private String custLinkman;
private String custPhone;
private String custMobile;
//在客户实体类表示所属级别
private Dict dictCustLevel;
public Dict getDictCustLevel() {
return dictCustLevel;
}
public void setDictCustLevel(Dict dictCustLevel) {
this.dictCustLevel = dictCustLevel;
}
private Set<Visit> setCusVisit = new HashSet<Visit>();
public Set<Visit> getSetCusVisit() {
return setCusVisit;
}
//省略部分无关