问题:
JPA Entity 如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
@Table (name= "EMP") @Inheritance @DiscriminatorColumn (name="EMP TPE") public abstract class Employee {...} @Entity @DiscriminatorValue ("CEmp") public class contractemployee extenas Employee{...} @MappedSuperclass public abstract class CompanyEmployee extends Employee {...} @Entity @DiscriminatorValue ("FTEmp") public class FullTimeEmployee extenas companyemployee {....} @Entity (name= "PTEmp") public class PartTimeEmployee extends CompanyEmployee {....} |
报错:
|
Resolved [java.lang.IllegalArgumentException: Id must be assignable to Serializable: null] |
解决:
Entity 中不要覆盖了super class 中的 id class
参考: