-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibern8IDE and UPDATE
PostPosted: Thu May 13, 2004 11:17 am 
Beginner
Beginner

Joined: Fri Oct 17, 2003 4:11 am
Posts: 40
Hi!
I'm using Hibern8IDE and i found that is a great tool!
It's possible to UPDATE record in the database?

I write:
Code:
HSettoreAttivita p=session.get(HSettoreAttivita.class,new Long(1));
p.nome="***";
session.saveOrUpdateCopy(p);
session.flush();
session.close();

but no UPDATE will perform on the db but the UPDATE query appear on standard output...

Any idea?
Gio


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 13, 2004 1:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
calling commit() is normally a good idea ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 14, 2004 3:36 am 
Beginner
Beginner

Joined: Fri Oct 17, 2003 4:11 am
Posts: 40
I know... I already tried but i don't found the object (transaction?!) to call commit() on! :)
"session.commit()" doesn't exist... "commit()" doesn't work...

Gio


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 14, 2004 3:47 am 
Beginner
Beginner

Joined: Fri Oct 17, 2003 4:11 am
Posts: 40
Ok! I found the solution... :)
Just to help other people that use Hibern8IDE and to chack if it's the right solution:
Code:
import net.sf.hibernate.Transaction;
Transaction t=session.beginTransaction();
HComune p=session.get(HComune.class,new Long(1));
p.nome="***";
session.saveOrUpdateCopy(p);
session.flush();
t.commit();


Thanx
Gio


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 14, 2004 4:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
session.connection().commit()

_________________
Max
Don't forget to rate


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