This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMR in entity bean

 
Deepa Malhotra
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say I have EMPLOYEE table and a DEPT table. EMPLOYEE table has the deptid which is the foreign key. And I can establish CMR between the two entity beans.
If EMPLOYEE table does not have deptid column (ie there is no common columns between tables) can I still establish a CMR between the two entity beans?
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If EMPLOYEE table does not have deptid column (ie there is no common columns between tables) can I still establish a CMR between the two entity beans?

It is not possible to establish the relation since employee does not know the department and the departement is not even null , it does not just exist.
 
Deepa Malhotra
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Preadeep.
But if you look at the CMP example in Sun's tutorial, we have a Teams entity bean and a League entity bean. The underlying tables do not have any common columns, but the beans have a 1:* relationship established thro CMR.
Am I making sense?
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please pass the link to the tutorial. I checked the j2ee 1.3 tutorial but did not mention of Leage entity. It was just Team and Player entities.
 
Bill Dudney
Author
Ranch Hand
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Is it possible that this is a *:* relationship and there is an association table between them? That seems to make sense (a team could be in more than one league).
Hope this helps.
 
Deepa Malhotra
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the link for that tutorial:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/CMP.html
League and Teams have 1:* relationship. One League can have many teams and every team just belongs to League.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic