GeeCON Prague 2014*
The moose likes JDBC and the fly likes Beans - representing 1-m relationships Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Beans - representing 1-m relationships" Watch "Beans - representing 1-m relationships" New topic
Author

Beans - representing 1-m relationships

Ed Lance
Ranch Hand

Joined: Aug 02, 2000
Posts: 38
We have recently started using java beans and I'm curious about the best way to retrieve and view data from queries involving 1-m realationships. On the veiw (jsp) I only want to display the data from the "1" record once, then loop through the data from the "many" (a basic control-break senario).
I am doing it by loading up a separate vector each time the key in the "1" record changes. In my view, I then use an enumeration to loop through each vector, instantiate the bean and call the properties I need at that point (Data is for display only, so not using a control servlet). Just curious if anyone has a better way.
Thanks!
 
GeeCON Prague 2014
 
subject: Beans - representing 1-m relationships