• Post Reply Bookmark Topic Watch Topic
  • New Topic

Establish relationship between two CMP EJB  RSS feed

 
adrian mills
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I have two CMP beans based on two tables Color and house.
Now,I want to establish a relationship between these two CMP EJB and their corresponding tables when none of the fields of these tables/relationships is a primary key of either table.

So between the two there is no such primary key which is a foreign key in the other table.

Can this be done.?? If yes can you explain how??
I would be really greatful if any one has done this before and can share how he has done it.

Thanks in Advance to all you ranchers.

Adrian
 
LazyCoder
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In CMPs if u dont have any primary keys it can be managed by specifying as unknown tab in deployment descriptor. and the PK returns should be Object.
but i have never tried out like urs. Checkout from my hint (using unknown tag and PKs as Object in ur bean and component classes. )
 
adrian mills
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi lazyCoder,
Can u give me a sample code as to how u have done it.
I am not getting exactly what u have done.
In my case the indiviual entity beans may have a unique primary key of their own.But between the two there is not foreign key to relate the two entities.
I will still try what u have mentioned but a sample code would be useful.
Thanks a lot for replying.I am really greatful
Adrian
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!