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: More control over SQL: single column update and sql
PostPosted: Fri Mar 24, 2006 5:13 pm 
Newbie

Joined: Thu Jan 13, 2005 11:41 pm
Posts: 10
As I'm new to Hibernate, I wanted to ask the following:
* If I have a simple query which updates a single column:
"update person set firstName='Joe' where id=1"
How do update only the first name without having to fetch the entire
object from the database (assuming I have the primary key) and
only by setting one object field?
* If I want to write my own SQL query/statement (hints, exotic syntax),
can I do so while still using Hibernate to execute it and populate the
POJOs?


Top
 Profile  
 
 Post subject: you can
PostPosted: Fri Mar 24, 2006 6:17 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Please see
http://www.hibernate.org/hib_docs/v3/re ... rysql.html
and
http://www.hibernate.org/hib_docs/v3/re ... tch-direct

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.