-->
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 Query
PostPosted: Wed Jun 16, 2010 3:52 am 
Newbie

Joined: Mon May 31, 2010 4:26 pm
Posts: 5
Hi,
I am retreiving values from a database based on a parameter using hibernate and displaying the data using struts.
The query i am using is

return session.createQuery("select a from Users as a where a.USERNAME like ?").setString(0,userName).list();

The code of the display page is
<table>
<tr>

<s:iterator value="userList" status="userStatus">
<tr>
<td><s:property value="USERNAME"/></td>


<td><s:property value="ID" /></td>



</tr>
</s:iterator>
</table>



The above code works fine. When i try to display only the username, using a.USERNAME in the query, i don't see any records.


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.