• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"JPA & Hibernate Training" - Keying on Embeddables

 
Bell Katapa
Ranch Hand
Posts: 57
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Richard,

I am currently on the path to JPA certification.

I.Y.O Are there enough and practical real-world justifications out there to warrant support in the JPA 2.x spec for keying on embeddables (rather than first class entities) when mapping key/value pair collections to relational data stores? Was this move more about 'completeness' than promotion of best design/coding practice? What's your take.
 
Richard Chesterwood
Virtual Pair Programmers Rep
Greenhorn
Posts: 29
7
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

A good deep question. I've never come across a situation where I've needed to use an embeddable as a key on map.

I'm not sure it's about completeness, there are still some important things missing from JPA (example at my blog here). Sometimes committee standards have eccentric elements that can often be explained away by "design by committee". Perhaps someone on the committee decided embeddable map keys were of critical importance and they just had a louder voice than everyone else?

If anyone at JavaRanch can give a good example of embeddable map key I'd be very interested. We don't cover them on the course by the way - honestly, I'd almost forgotten they existed!

Cheers,
Richard.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic