-->
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.  [ 4 posts ] 
Author Message
 Post subject: how to update from database table directly?
PostPosted: Fri Sep 01, 2006 1:42 am 
Newbie

Joined: Mon Aug 21, 2006 9:15 pm
Posts: 17
I'm now using hibernate as main database access layer.
but I want to do one simply sql statment, which I think no need to mapping to Class, because it's too easy, and it's used temporarily.

I want to run " update lastruntime set lasttime=:lasttime".
but if I using createQuery, hibernate report error, because HQL only can be written with Class name, not table name. then I using creatSqlQuery.
and then call sqlQuery.setTimeStamp("lasttime",lasttime), hibernate still report error, this time, it says SqlQuery can only made query.

how to resolve this problem? (I don't want to use direct undlying connection)

thanks inadvance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 01, 2006 5:11 am 
Newbie

Joined: Mon Aug 21, 2006 9:15 pm
Posts: 17
I'm so urgent, no one can help me?
thanks a lot for help.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 03, 2006 9:18 am 
Newbie

Joined: Mon Aug 21, 2006 9:15 pm
Posts: 17
still no one answer, thanks in advance,can someone gives me a manner to resolve it?


Top
 Profile  
 
 Post subject: Manual
PostPosted: Tue Sep 05, 2006 8:00 am 
Regular
Regular

Joined: Wed Aug 24, 2005 11:49 am
Posts: 63
There is an example in the reference documentation (chapter 13.4)

Did you try this? You didn;t specify which version of Hibernate you are using, so maybe it is not available in your version.


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