Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @Table(name = "group_of_students")
- @Inheritance(strategy = InheritanceType.JOINED)
- public abstract class AGroupOfStudents extends AModel {
- }
- @Entity
- @Table(name = "cohort")
- @PrimaryKeyJoinColumn(name = "id")
- public class Cohort extends AGroupOfStudents {
- @Column(nullable = false)
- // @NaturalId <- here is the problem
- private int number;
- }
- @Entity
- @Table(name = "centuria")
- @PrimaryKeyJoinColumn(name = "id")
- public class Centuria extends AGroupOfStudents {
- @Column(nullable = false)
- // @NaturalId <- here is the problem
- private int cohort;
- @Column(nullable = false)
- // @NaturalId <- here is the problem
- private char maniple;
- }
- AnnotationException: @NaturalId only valid on root entity (or its @MappedSuperclasses)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement