-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate HQL returns same objects.
PostPosted: Wed Nov 12, 2008 12:29 pm 
Newbie

Joined: Wed Nov 12, 2008 12:16 pm
Posts: 15
For some reason when i run my createQuery from the Session object that is initialized, it returns the correct number of objects, but the objects are duplicated. It seems that hibernate pulls the first row it finds containing my first column value.

Example:

DB Table

ROW_1 ROW_2 ROW_3 ROW_4
1234 abcd 10-08-2008 dev
1234 efgh 11-08-2008 dev
1234 ijkl 12-08-2008 dev
1234 mnop 1-08-2009 dev

if this were the data contained in my table and i had an HQL like this:

String SQL_STRING = "FROM UnitData data WHERE data.row4 = '" + row4 + "' ORDER BY data.row1 asc";

I would get 4 UnitData objects all with the same data:
1234 abcd 10-08-2008 dev

Any ideas as to why that happens?

_________________
Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.