Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invalid composite primary key specification

 
Ashley Bye
Ranch Hand
Posts: 132
2
Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this topic has come up in the past, but after looking through previous posts and a lot of "Googling" I am still utterly confused as to why I get the above error. The relevant exception in full is:

The relevant sections of my entity classes are shown below.

User.java

FlyingClub.java

FlyingClubStaff.java

Relevant database schema (if needed)

Since I have annotated the fields with @Id in the entity class I have not added any reference to them in persistence.xml.

Any help / pointers in the right direction welcome.
 
Janeice DelVecchio
Saloon Keeper
Posts: 1809
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's the class named FlyingClubStaffID?

@IdClass(FlyingClubStaff.FlyingClubStaffID.class)
 
Ashley Bye
Ranch Hand
Posts: 132
2
Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would appear I forgot to post that class. I solved the problem using an embeddable class and an embedded id. I say I solved the problem, I gave up and got NetBeans to solve the problem for me. I'll revisit coding it by hand another time. For now, I've stepped down a notch to a smaller project which doesn't have any composite keys so I can get the hang of things - people don't run before they learn to crawl and walk after all!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic