-->
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: Custom sql w/ named params?
PostPosted: Sat May 28, 2005 11:34 am 
Newbie

Joined: Thu May 27, 2004 9:41 pm
Posts: 6
According to the H3 docs, looks like custom sql (i.e. <sql-insert>, <sql-delete>, etc.) does not support named parameters?

Is this something that is on the roadmap, or is it implemented and just not yet documented?

I have a case where I need to only override the <sql-delete>... we are using an effective date record pattern and I want to essentially expire the record.... so do an update in the overridden <sql-delete>... sounds odd, however that is the case.

When I override the sql-delete with an update (to set the effective end date to now, as well as set the userid that did this logical delete)...

Basically it isnt binding the params properly because they are positional
(?,?,?)

Code:
i.e.  update TABLE set eff_to_date = systimestamp, user_oid = ? where ID = ? and VERSION = ?

What is happening is that the ID and VERSION parameters are being bound, however not the user_oid...

Anyway, my assumption is that a named parameter (i.e. :user_oid ) would get around the positional issue.

Otherwise if someone has a good idea how to do a <sql-delete> with an update....

Also, if the named parameters for custom sql is on the roadmap or needs someone to do it.. let me know... I could contrib..

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 28, 2005 9:34 pm 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
use Stored procedures, in the code of stored proc, make the correct job.

Quote:
<sql-insert callable="true">{call createPerson (?, ?)}</sql-insert>


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.