• 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 Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Parent child join query

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

I have a parent table and a child table with one-to-many relationship. Each parent record is related to one or more child records.

For example each record in PEOPLE (parent table) has one or more records in PHONE (child tables).

I have an application which generates an XML file from the result object returned from the PEOPLE table. The structure of the output is like



If I run a simple query on the PEOPLE table due to the association with the PHONE table, it runs a series of associated select on the child tables. To avoid this I make use of from the parent table onto the child table. But when I run this query I get duplicated entries for each record which has more than one phone number.

I think I have to make use of tuple queries to remove this duplication in results, but not sure how to do it. Can anyone suggest me the approach to do it.

thanks in advance
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post your mapping files, and your code for the query.

Mark
 
Raaj Aaryan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the mapping file of the parent table


and the query is



I have tried to remove these duplications using a tuple query but I am still curious to solve my earlier problem
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic