• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

regarding query

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a table with two fields invno and itemno, the invoic number gets repeated and so the item number also.
If i give a query in sql like - select itemno from invno where invno=1, i get all the items associated with the invoice number.

how do i achieve the same thing in hibernate
I have written a pojo for the table and also a mapping file and when I query the pojo I get a peculiar result
for example

invno | itemno
1 | 20
1 | 10
1 | 5

when i issue the query like
session.find("from inv where invno=1")
and if i iterate the result, then it will display
20
20
20

but i want
20
10
5

hope i am clear, please help

thanks in advance..
reply
    Bookmark Topic Watch Topic
  • New Topic