File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes one to many relations using ejb 2.x ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "one to many relations using ejb 2.x ?" Watch "one to many relations using ejb 2.x ?" New topic
Author

one to many relations using ejb 2.x ?

U Kvistborg
Greenhorn

Joined: Oct 14, 2002
Posts: 29
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


SCJP 1.4/1.5, SCWCD 1.4, SCBCD 1.3
 
Consider Paul's rocket mass heater.
 
subject: one to many relations using ejb 2.x ?
 
Similar Threads
Hibernate Many-to-many using link table
EJB Question. Add a new column to Many-to-many relation generated table.
db desgin question: how to improve the relationship in this schema
0 x N in hibernate (null values in a FK field)
Hibernate: Can someone verify my mapping configuration?