Can't we just solve this with an XML configuration option?  We could specify the Type 
we need to get through reflection.  We could even specify to use execute() or 
executeQuery() through the configuration.  Isn't it is better than hacking up the 
code?  I would gladly do it myself and submit a patch.  Could you just point me to the 
package/class that it would best fit into?

I know the JDBC implementers could have done it different ways but I think providing a 
way to specify which out parameter to get the resultset from should be a feature.  And 
specifying in the XML mapping which type (eg. OracleTypes.CURSOR) to use doesn't seem 
like a big deal either.  But let me know if I'm wrong about that.

Note: http://forum.hibernate.org/viewtopic.php?t=11&highlight=stored+procedure
Seems like someone did some work on this.  Did they submit it to cvs or somewhere so I 
don't have to start from scratch?

-----Original Message-----
From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 15, 2004 3:07 PM
To: March, Andres
Cc: [EMAIL PROTECTED]
Subject: Re[2]: [Hibernate] Oracle stored procedures

Hello Andres,

The problem as you yourself mention is that it is Oracle specific (as
it require an import com.oracle.jdbc.OracleTypes)

In MS SQL Server, DB2, Interbase, Sybase, Informix you can (more or
less) do

> CallableStatement st = null;
> ResultSet rs = null;
> st = session.connection().prepareCall("{call ? := ...}");
> st.setObject(2, optionalID);
> rs = st.executeQuery();

Which would be MUUCH nice since then the existing executeQuery() calls
in hibernate core would work nicely without any "tweaks"!

Im the only one looking into this at the moment, but you are more than
welcome to see if you can find a better way out of this "just for
oracle tweak".....any contribution will be welcome ;)

/max


Tuesday, June 15, 2004, 11:39:55 PM, you wrote:

> This seems to work for me.  Obviously this is oracle specific but
> we can make it extensible.  I can write all the oracle specific code
> for this, if necessary.  I just don't want to have to deal with
> resultsets anymore.  I have not checked out the latest Hibernate3
> from CVS yet.  I will check it out.  Please let me know if someone
> has gone down this path already.

> -Andres. 

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> March, Andres
> Sent: Tuesday, June 15, 2004 2:09 PM
> To: Max Rydahl Andersen
> Cc: [EMAIL PROTECTED]
> Subject: RE: [Hibernate] Oracle stored procedures

> I saw this on the forums.  Does it not work?

> CallableStatement st = null;
> ResultSet rs = null;
> st = session.connection().prepareCall("{call ? := ...}");
> st.registerOutParameter(1, OracleTypes.CURSOR);
> st.setObject(2, optionalID);
> st.execute();
> rs = (ResultSet)st.getObject(1);

> - Andres

> -----Original Message-----
> From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 15, 2004 1:53 PM
> To: March, Andres
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Hibernate] Oracle stored procedures

> Hello Andres,

> Tuesday, June 15, 2004, 5:49:06 PM, you wrote:

>> I was wondering if there is any progress being made ongetting
>> Oracle stored procedures working with hibernate CRUD queries.  I
>> wouldlike to help out in this area if possible.  One of the things I
>> would like tobe able to do is specify one of the out parameters to
>> be used as the resultset.

> Hibernate3 has support for CUD operations in stored procedures.

> R as in Read has not been implemented as at the moment the team
> haven't found a good way (read standard) to get a out parameter as a
> resultset.

> Do you know a way ? ;)

> (note: it actually seems like Oracle is the only major player who
> don't have proper out parameter as resultset support - which I find
> kind of weird ;)

> /max

>>  

>> -----------------------------------------

>> Andres March

>> Platform - Apps Engineering

>> Sony Online Entertainment

>> desk: 858.577.3373

>> cell:   619.519.1519

>>  










-- 
Best regards,
 Max                            mailto:[EMAIL PROTECTED]





-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to