File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes @JoinTable or  @JoinCol... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "@JoinTable or  @JoinCol..." Watch "@JoinTable or  @JoinCol..." New topic
Author

@JoinTable or @JoinCol...

Dupon David
Greenhorn

Joined: Aug 11, 2006
Posts: 19
Hello.
as I still did not solve my problem, I will try to reformulate my question I want to make request EJB3 QL with joint.
here my tables:



Knowing that I have the following table which has like cl�s primary both cl�s primary of the tables the preceding one.



knowing that cardinality between these tables and ManyToMany, my question and to know if so that I can make a join

between my tables I must create tables interm�diates which contain that the primary keys like umlssnmi_wasnmi kind

and whoart_wasnmi for example, and to make @JoinTable; or the table "wasnmi" will join the tables.

I thank you in advance
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Hi,

A JPA provider would use the join table and automatically join across the many-to-many relationship between the two entity tables, but there is no support (in Java!) for putting state on relationships. If you have state (more than just foreign keys) in your join table then you need to model it using a relationship entity that is related in a many-to-one to each of the two entities and make the two entities have a one-to-many back to the relationship entity.

Hope this helps,
-Mike


-Mike
Pro JPA 2: Mastering the Java Persistence API
Dupon David
Greenhorn

Joined: Aug 11, 2006
Posts: 19
Hello Mr Mike Keith.
Initially I thank you for your book Pro EJB3, it is very interesting (it is also the opinion of my colleagues).
I also thank you for your answer which I tried to implement as follows:

For table WHOART:
For UMLSSNMI table:



The TermProjPK class which contains the primary keys of table WASNMI:



For WASNMI table:



That does not function, because I do not know how I can reach the fields ` MODIF' and ` SRC' of the table ` WASNMI' starting from TermSource object.

Somebody already made there?. Any suggestion will be come well it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @JoinTable or @JoinCol...