-->
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.  [ 6 posts ] 
Author Message
 Post subject: Access to the column<->property mapping at fetch
PostPosted: Tue Feb 17, 2004 12:28 am 
Regular
Regular

Joined: Wed Dec 31, 2003 4:26 am
Posts: 108
Location: Berkeley, CA
I'm wanting to use Hibernate, but at least on of my classes is usually fetched via a Stored Procedure, not directly from a table.

To support SPs I'm using SpringFramework's JDBC support. Part of that lets me write a simple method that maps a single row of a ResultSet to an object and Spring takes care of the rest.

It occurs to me that Hibernate in its bowels must do the same thing: take a row of a ResultSet and return an object. I'm hoping some kind soul can point me to the write entry point of the source code -- possibly a class to subclass or at least to invoke as a helper...?

I've started digging on my own, but it got a bit dense and a pointer from someone more intimately familiar with the code would be a big help.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 4:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
It occurs to me that Hibernate in its bowels must do the same thing: take a row of a ResultSet and return an object.


Loader does this.

However, usually this problem is solved using a custom persister, not a new Loader.

We will almost certainly add a standard StoredProcedurePersister in 2.2.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 6:36 am 
Regular
Regular

Joined: Wed Dec 31, 2003 4:26 am
Posts: 108
Location: Berkeley, CA
[quote="gavinHowever, usually this problem is solved using a custom persister, not a new Loader.[/quote]

Could you elaborate on the differences (or point to a link which goes into details)? I'm interested in the reading from the DB, so from the names of things Loader sounds right. What is the difference in this case?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 6:56 am 
Regular
Regular

Joined: Wed Dec 31, 2003 4:26 am
Posts: 108
Location: Berkeley, CA
Is there an easay way (e.g., via Configuration) to have Hibernate use a custom persister?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 7:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
<class persister="...">


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 4:15 pm 
Regular
Regular

Joined: Wed Dec 31, 2003 4:26 am
Posts: 108
Location: Berkeley, CA
Yes, for a class, but I just want the persister to be used when a particular parent<->child relationship is traversed.... any pointers? The short of it is, the stored procedure in question must have the foreign key's value.


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