-->
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.  [ 5 posts ] 
Author Message
 Post subject: Stored procs usage once again (Oracle)
PostPosted: Tue Feb 06, 2007 9:12 am 
Newbie

Joined: Tue Feb 06, 2007 9:00 am
Posts: 3
Hi All!

I cant seem to find info related to using named variables in stored procs.
Is it possible to somehow bind parameters by place not by position, like this:

Code:
<class name="Customer"
         table="CUSTOMER"
         where="DATE_TO IS NULL">
    <id name="Id" type="System.Int64" column="CUSTOMER_ID">
      <generator class="sequence">
        <param name="sequence">CUSTOMER_ID_SEQ</param>
      </generator>
    </id>

    <property name="CustomerTypeId" type="System.Int32" column="CUSTOMER_TYPE_ID"/>
    <property name="DateFrom" type="System.DateTime" column="DATE_FROM"/>
    <property name="INN" type="System.String" column="INN"/>
    <property name="IsPrivate" type="System.Boolean" column="IS_PRIVATE"/>
    <property name="Note" type="System.String" column="NOTE"/>
    <property name="RegistrationAddressId" type="System.Int64" column="REG_ADDRESS_ID"/>
...
    <sql-update>
      call CUSTOMER_UPD.UPD_CUSTOMER
        :p_customer_id,
        :p_customer_type_id,
        :date_from,
        :p_inn,
        :p_is_private,
        :p_note,
        :p_reg_address_id,
    </sql-update>


NHibernate tells me that:
DEBUG NHibernate.SQL - call CUSTOMER_UPD.UPD_CUSTOMER
:p_customer_id,
:p_customer_type_id,
:date_from,
:p_inn,
:p_is_private,
:p_note,
:p_reg_address_id,; :p0 = '1', :p1 = '23.11.2004 15:05:06', :p2 = '123456789', :p3 = 'False', :p4 = '1234', :p5 = '102', :p6 = '53'
NHibernate.Util.ADOExceptionReporter - ORA-01036

Hibernate version: 1.2.0 b3

Name and version of the database you are using: Oracle 9i


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 9:42 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
No, it's not possible at this time.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 10:02 am 
Newbie

Joined: Tue Feb 06, 2007 9:00 am
Posts: 3
Did you think about managing stored procs not as simple sql-queries, but by introducing new xml:element in class, smth like:

Code:
<sql-insert>
   <stored-procedure name="packet.procName">
       <parameter name="" property-ref="">
       ...
   </stored-procedure>
</sql-insert>


or

Code:
<sql-insert type="storedProcedure">
       <parameter name="" property-ref="">
       ...
       packet.procName
</sql-insert>


Of course, such changes will affect a lot, maybe even IDriver, but better support for SP is IMHO undoubtedly needed.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 10:52 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Patches are always welcome ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 11:18 am 
Newbie

Joined: Tue Feb 06, 2007 9:00 am
Posts: 3
Sergey, how architectural issues are resolved? Its possible, that such a patch could result in minor architectural changes and affect for example Drivers implementation.


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