我有这个代码(只需用ALOT乘以属性数):
@Entity
@Table(name = "MY_TABLE")
@Immutable
public class MyEntity {
@Id
@Column(name = "ID")
private String id;
public static final String PROPERTYNAME_ID = "id";
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
/* used by JPA, needs to have same getters/setters as MyEntity */
public class MyEntityCriteria {
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
有没有办法在这些类之间共享属性,getter和setter? ('延伸'不起作用,因为它也分享注释......)