Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding query

Posts: 1
  • Mark post as helpful
  • send pies
  • 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

but i want

hope i am clear, please help

thanks in advance..
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!