• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@JoinTable or @JoinCol...

 
Dupon David
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dupon David
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic