• 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

Getting same record in query.

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi List,
When i run the query in oracle prompt its show two different record.But when i try to get the records in the view page its show same records i.e
same rows more than one.

My HBM file:

My POJO Class is


I am calling like this



Pl help me where is the mistake.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The number of records that you are getting from the Query execution via Hibernate and from console are same, the only difference is the values of the row ? Is that correct ?

I did not find definition of clear(); what is the role of this method in the finally block ?

Have you tried wrapping your query execution with in transaction limits ? I know it does not make much sense here because you are getting some records fetched, but please try that once.

Also, could you paste the outcome of the System.out.println statements and the one that you are getting from the console.


Regards,
Naresh Waswani
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,
Records count is coming same.But rows value repeating.

Hibernate generate the sql like this:


And in sql console the output coming like this


But when i put


Its prints two value Setup and Setup in java console.It should print Setup and Barcode.

I used clear(); to clear the hibernate session.


 
reply
    Bookmark Topic Watch Topic
  • New Topic