I\'ve created an entity that uses @Id to point to an @Embeddable compound key. Everything I believe works fine as is. However, after switching @Id to @EmbeddedId everythin
It's too late for this answer but in case it helps.
I referred hibernate docs Hiberate 3.5 annotations reference whereby there is the difference that with @EmbeddedId
you can skip annotating the entity class @Embeddable
but with @Id
its required.
I tried using @Id
without @Embeddable
it gives exception:
org.hibernate.mapping.SimpleValue cannot be cast to org.hibernate.mapping.Component
Just this and no extra info like the field or class name.
Well this behavior is as of Hibernate 4; I dont know about other JPA providers. I will test a few and update post accordingly if there are any more findings.
I hope this helps someone!