Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

DAO for cross-table queries

Thread view: 
Maciej - 10 Oct 2006 13:56 GMT
Hi,

Imagine the following situation. I've got two tables in my DB: shops
and products. For each of them I've created seperate DAO (Date Access
Object), so I could ask such question: what is the name of shop X or
add new product. By the given table are connected via relation:
shop-sells-product. So there is a need to build yet another DAO for
cross-table queries, isn't?
What is a good, common-used practice for such situations?

Regards,
Maciej
Manish Pandit - 10 Oct 2006 17:10 GMT
Hi,

You do not need another DAO. This is a bidirectional one to many
relationship, so you can have a collection in both classes. Shops can
contain a Collection or Products, and Product can contain a Collection
of Shops where it is sold.

-cheers,
Manish


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.