Page 1 of 1
About Question enthuware.oce-jpad.v6.2.424 :
Posted: Fri Mar 27, 2015 5:27 am
by stiekemaj
Can you please explain why the 4th answer is incorrect? It is not mandatory to create an @IdClass or @EmbeddableId mapping to map multiple Id attributes, so in my opinion the 4th answer is also correct.
Re: About Question enthuware.oce-jpad.v6.2.424 :
Posted: Fri Mar 27, 2015 5:52 am
by stiekemaj
Oh, never mind. I've checked the jpa 2.0 specs, and it says that you need either an EmbeddedId or an IdClass to map a composite id.
Although, I'm really sure that EclipseLink allows multiple @Id attributes without an @IdClass annotation, so I think that's the reason why I was convinced about the correctness of the 4th answer. Naughty naughty eclipselink for not adhering the JPA standards

Re: About Question enthuware.oce-jpad.v6.2.424 :
Posted: Sun Sep 20, 2015 10:32 am
by romsky
Spec says:
• The primary key class must be serializable.
• The primary key class must define equals and hashCode methods. The semantics of value
equality for these methods must be consistent with the database equality for the database types to which the key is mapped.
Please change your EmployeePK class.
Re: About Question enthuware.oce-jpad.v6.2.424 :
Posted: Sun Sep 20, 2015 9:15 pm
by admin
Added.
thank you for your feedback!