Issue
class A implements Serializable{
private static final long serialVersionUID = 1L;
@Id
Integer id;
...
// constructor getter and setter
}
@Entity
class B extends A{
private static final long serialVersionUID = 1L;
@Column
String name;
@Column
String age;
...
//constructors, getters and setters
}
As you see above, class A
extends from class B
, B
should have the identifier id
inheritance from A
. but i got the No identifier specified for entity: com.d.e.B
what did i missed? thanks in advance.
Solution
You missed the @MappedSuperclass
annotation on A, to tell Hibernate/JPA that properties and JPA annotations found in A must be considered.
Answered By - JB Nizet
Answer Checked By - Mildred Charles (JavaFixing Admin)