-->
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: Query return a list of same record.
PostPosted: Mon Oct 30, 2006 4:52 pm 
Newbie

Joined: Tue Sep 12, 2006 2:20 pm
Posts: 6
I am using hibernate query language WHERE clause to select some records from my table. it returns the correct number of records. The first record is correct. but all subsequent elements are exactly the same as the first record. I wonder why it is doing that. please help. Thanks

Code here:


String SQL_QUERY = "from Roleauthority roleauth where roleauth.Id=1";
Query query = session.createQuery(SQL_QUERY);
for (Iterator it = query.list().iterator(); it.hasNext();) {
System.out
.println("inside getRoleAuthorityByRole, searching Roleauthority for roleId=1 ");
Roleauthority roleauth = (Roleauthority) it.next();
if (roleauth != null) {
System.out.println("got a roleauthority "+roleauth.toString());
RoleAuthorityInfo roleAuthInfo = new RoleAuthorityInfo();
System.out.println("use case name = "+roleauth.getUsecasename());
}
}


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.