-->
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.  [ 4 posts ] 
Author Message
 Post subject: Allowing Hibernate to map from your ResultSets
PostPosted: Tue Nov 25, 2003 4:37 pm 
Newbie

Joined: Tue Nov 25, 2003 4:31 pm
Posts: 12
Location: Minnesota
I'm wondering if Hibernate can take a ResultSet object and produce an object or list based on a mapping definition?

---


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 6:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Not sure if this is what your after but HQL does allow a query to be projected and this then can be stored in a Data object. The result is a List of object from the resultset, eg,

sess.find("select new DataObject(o.field1, o.field2) from o in class DomainObject ");


Top
 Profile  
 
 Post subject: Re: Allowing Hibernate to map from your ResultSets
PostPosted: Tue Nov 25, 2003 6:17 pm 
Newbie

Joined: Tue Nov 25, 2003 5:05 pm
Posts: 18
hookomjj wrote:
I'm wondering if Hibernate can take a ResultSet object and produce an object or list based on a mapping definition?

---

This is not possible in hibernate but you can do this with SQLJ to some extend.

ciao
Sven


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 25, 2003 6:33 pm 
Newbie

Joined: Tue Nov 25, 2003 4:31 pm
Posts: 12
Location: Minnesota
david wrote:
Not sure if this is what your after but HQL does allow a query to be projected and this then can be stored in a Data object. The result is a List of object from the resultset, eg,

sess.find("select new DataObject(o.field1, o.field2) from o in class DomainObject ");


So this would allow me to limit the fields being pulled from the database in the case of presenting a user with a larger list objects where we only want to show them *10%* of the fields--- in hopes of improving performance?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.