• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

one to many relations using ejb 2.x ?

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have a few tables, an example could be like I have a person that have many cars, a person table and a car table. Where the person have a pk as some id, and the cars have a fk to the persons pk.
Now if I wanna get the person bean I want the cars to be on the bean that the person owns. So I could say person.getCars() and get the collection with the Cars object belonning to this person.

There is ofcourse one solution and that is to have a domain object representing the person and for each person add the car objects. But is there any easier way to do this, e.g. via the eql. ? So I directly on my person bean have access to the cars ?

Brgds
reply
    Bookmark Topic Watch Topic
  • New Topic