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

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
romsky
Posts: 39
Joined: Thu Jan 29, 2015 4:49 pm
Contact:

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

Post by romsky »

The 4th option works ok with Hibernate.

Why do You think that "@JoinTable annotation is used when there is no additional column in the join table." ?

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

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

Post by admin »

As per Section 2.7.2, when the value type of the map is a basic type or an embeddable class, a collection table is used to map the map.

Here, ProjectAllocation is not an entity but an embedded class, that is why CollectionTable is more appropriate.
If you like our products and services, please help us by posting your review here.

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

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

Post by romsky »

admin wrote:As per Section 2.7.2, when the value type of the map is a basic type or an embeddable class, a collection table is used to map the map.

Here, ProjectAllocation is not an entity but an embedded class, that is why CollectionTable is more appropriate.
My question is not about @CollectionTable, but rather about Your statement:
"@JoinTable annotation is used when there is no additional column in the join table."

Why do You think so?

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

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

Post by admin »

Because if there are additional columns, you use the @CollectionTable. It follows from the same statement. If there are no additional columns, you can use @JoinColumns just like you do for any other one to many or many to many relationship.
If you like our products and services, please help us by posting your review here.

l.szepiola
Posts: 2
Joined: Thu Jan 07, 2016 3:33 pm
Contact:

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

Post by l.szepiola »

Hello! Since the joinColumn element of @CollectionTable is not specified, shouldn't the join column name in EMP_PROJECTS table be defaulted to EMPLOYEE_<Name of id attribute> ?

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

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

Post by admin »

Yes, you are right. Should be fixed.
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 12 guests