• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Establish relationship between two CMP EJB

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic