-->
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.  [ 2 posts ] 
Author Message
 Post subject: using scalar results in <logic:iterate
PostPosted: Sat May 08, 2004 8:46 am 
Newbie

Joined: Fri Apr 09, 2004 9:21 am
Posts: 9
Hello.

When selecting just a few elements from a object like this:
query = session.createQuery("Select a.name,a.adress from someObject a");
return query.list();

I get a List of scalars.

How would I use this in a jsp page if I want to use a <logic:iterate tag, and not manually create a scriptlet that will loop the list?

Is there a way to convert the scalar into the object it actually is supposed to represent (someObject), and leave the unused properties blank/null ?
This way I could do:

<logic:iterate id="element" name="name" scope="session" type="someObject " >
<bean:write name="element" property="adress />


I need some advice on how to combine scalar results with jsp iterate tag.

Regards Christian H.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 10, 2004 11:54 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Code:
select new SomeObject(a.name,a.adress) from someObject a

_________________
Emmanuel


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

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.