jjzjj

EmployeeEntityTwo

全部标签

java - 使用@IdClass 存储具有复合主键的实体,但无法持久化

我的id类如下,publicclassEmployeeIdimplementsSerializable{publicEmployeeId(){}publicEmployeeId(Integerid,Stringcountry){this.id=id;this.country=country;}privateIntegerid;privateStringcountry;@OverridepublicinthashCode(){returnthis.getCountry().hashCode()+getId();}@Overridepublicbooleanequals(Objecto){