-->
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.  [ 1 post ] 
Author Message
 Post subject: Named Query for updating a table
PostPosted: Fri Oct 01, 2004 2:06 am 
Beginner
Beginner

Joined: Thu Sep 30, 2004 4:17 am
Posts: 21
Hibernate version: 2.1.4

In the "Hibernate In Action" book, I see:

Quote:
The getNamedQuery() method obtains a Query instance for a named query:
session.getNamedQuery("findItemsByDescription")
.setString("description", description)
.list();

In this example, we execute the named query findItemsByDescription after binding
a string argument to a named parameter. The named query is defined in mapping
metadata, e.g. in Item.hbm.xml, using the <query> element:
<query name="findItemsByDescription"><![CDATA[
from Item item where item.description like :description
]]></query>


Is it possible to do a similar named query for an UPDATE statement in Hibernate? I require this to overcome legacy database difficulties with Hibernate. If possible, please provide some code example or point me to the resource.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.