This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Hibernate Query by Example

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I'm stuck with a problem.
I want to use Hibernate Query by Example but am getting a problem with my result.
I'm querying over two tables, a parent-child situation.

I have a class called CheckSum and a class called Record.
CheckSum has a set of Record.
When i execute the query, the resultset of CheckSum is equal to all the resultset of Record.
I'm not getting a parent-child resultset.

Thus is CheckSum has {chk01,chk02,chk03}
chk01 has {rec01,rec02}
chk02 has {rec03,rec04,rec05}
chk03 has {rec06,rec07,rec08}

if I query chk02 and all his record I get a list of 3 CheckSum and in all those 3 the same amount of record is repeated.

How does query by example work with joins???

thanks in advance.

 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does Record have a primary key?
 
yusuf nazir
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Record does have a primary key and so does checksum

This is the record class:



this is the hibernate record mapping:


This is the checksum class:


this is the checksum hibernate mapping:

 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic