我想创建通用表单来编辑我的恩赐。 我为我的实体创建了带有通用字段的抽象mappedsuperclass。 实施例
@MappedSuperclass
public abstract class Reference implements Serializable {
@Id
@Column(name = "Id", updatable = false, nullable = false, columnDefinition = "uniqueidentifier")
private UUID id;
@Column(name="Code")
private String code1
private String code2
private String code3
...any fields
...getter and setters
}
@Entity
public class Entity1 extends Reference {
private String field1;
private Integer field2;
... getters and setters
}
@Entity
public class Entity2 extends Reference {
private String field1;
private Integer field2;
private Integer field3;
private Integer field4;
... getters and setters
}
我想创建一个表单来编辑我的实体只有字段code1 code2 code3。 我该怎么办?