Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

element collection issue  RSS feed

Sanjay Jha
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I have a question on @ElementCollection concept.

In pro jpa 2, if we are using ElementCollection, then the join table will have composite primary key that is if Elementcollection is basic type and assuming source entity has one primary key (for example pkid), then primary key in join table would be the 2 columns (pkid and basic var name in embedded class) and also same for embeddable element collection(pkid and all field of embeddables)

but when I am doing the same example using jpa-hibernate and MySQL server, the tables are showing pkid as primary key for both the cases, could anyone please clarify. thanks in advance.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!