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());
}
}
|
|