我有两个班级。一个通用的抽象父类和一个扩展这个父类的子类。
@Setter
@Getter
public abstract class JPAEntity {
@Id
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator")
@Column(name = "uuid", columnDefinition = "CHAR(36)")
private String uuid;
@NonNull
@Column(name = "update_date")
private Date updateDate;
@NonNull
@Column(name = "creation_date")
private Date creationDate;
}
@Entity
@Table(name = "doc_document")
@EntityListeners(AuditingEntityListener.class)
@Setter
@Getter
public class Document extends JPAEntity {
@NonNull
@Column(name = "name", length=200)
private String name;
@Column(name = "status", length=50)
private String status;
}
但是 - Document 类上没有父方法 - 比如 getUuid()。 我做错了什么?