Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. @Entity
  2. @Table(name = "group_of_students")
  3. @Inheritance(strategy = InheritanceType.JOINED)
  4. public abstract class AGroupOfStudents extends AModel {
  5. }
  6.  
  7. @Entity
  8. @Table(name = "cohort")
  9. @PrimaryKeyJoinColumn(name = "id")
  10. public class Cohort extends AGroupOfStudents {
  11.  
  12. @Column(nullable = false)
  13. // @NaturalId <- here is the problem
  14. private int number;
  15. }
  16.  
  17. @Entity
  18. @Table(name = "centuria")
  19. @PrimaryKeyJoinColumn(name = "id")
  20. public class Centuria extends AGroupOfStudents {
  21.  
  22. @Column(nullable = false)
  23. // @NaturalId <- here is the problem
  24. private int cohort;
  25.  
  26.  
  27. @Column(nullable = false)
  28. // @NaturalId <- here is the problem
  29. private char maniple;
  30. }
  31.  
  32. AnnotationException: @NaturalId only valid on root entity (or its @MappedSuperclasses)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement