表里有个firstName和lastName 2个列实体类也有firstName和lastName 2个属性,
并且又加了个fullName属性 怎么设置它,
就是让它不在数据库生成新的列,
而是对应的firstName+lastName加起来的字符啊
并且又加了个fullName属性 怎么设置它,
就是让它不在数据库生成新的列,
而是对应的firstName+lastName加起来的字符啊
那你就用@Transient标识它,然后在在get()和set()里面都这么设置: public String getFullName(){
return this.firstName+this.lastName;
}
public void setFullName(){
this.fullName = this.firstName+this.lastName;
}