About Question enthuware.oce-jpad.v6.2.424 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
stiekemaj
Posts: 8
Joined: Sun Jan 25, 2015 6:08 am
Contact:

About Question enthuware.oce-jpad.v6.2.424 :

Post 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.

stiekemaj
Posts: 8
Joined: Sun Jan 25, 2015 6:08 am
Contact:

Re: About Question enthuware.oce-jpad.v6.2.424 :

Post 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 ;)

romsky
Posts: 39
Joined: Thu Jan 29, 2015 4:49 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.424 :

Post 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.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.424 :

Post by admin »

Added.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests