my dog learned polymorphism*
The moose likes Object Relational Mapping and the fly likes Sending list of records to Named Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Sending list of records to Named Query" Watch "Sending list of records to Named Query" New topic
Author

Sending list of records to Named Query

Mohammed Yousuff
Ranch Hand

Joined: Oct 17, 2007
Posts: 198
I am using named query, to update a list of trasactions.

<sql-query name="updateErrors">
UPDATE TEST_ClEARING_TXNS SET TXN_CLEARING_STATUS=:TXN_CLEARING_STATUS,MODIFIED_BY=:MODIFIED_BY,MODIFIED_DT=:MODIFIED_DT WHERE TRANSACTIONEVENT_ID =:ALL_TRANSACTIONEVENT_ID
</sql-query>

i want to send a list of txn ids to ALL_TRANSACTIONEVENT_ID column, may i know how can i send a list of records to named query???

thanks a lot


My Thoughts : http://passion4java.blogspot.com
Try not to become a man of success but rather to become a man of value.
Javid Jamae
Author
Ranch Hand

Joined: May 14, 2008
Posts: 198
Off the top of my head, I think your where clause needs to be:

WHERE TRANSACTIONEVENT_ID in :ALL_TRANSACTIONEVENT_ID

then you need to use the setParameterList method. For example:

session.getNamedQuery("updateErrors").setParameterList( ... )


Author: JBoss in Action, javidjamae.com, @javidjamae on Twitter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending list of records to Named Query
 
Similar Threads
my servlet can't initialize: null
native SQL update in Hibernate
Problem with Oracle CONNECT BY
Named query result mapping error
listing hibernate named queries from java