-->
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: Bug in Hibernate Query Language
PostPosted: Mon Oct 12, 2009 10:55 pm 
Newbie

Joined: Mon Oct 12, 2009 10:51 pm
Posts: 1
The executeUpdate spelling is wrong... Please check line 11..... I have downloaded latest version of hibernate. More over it is not letting me delete the record.

public static void main(String[] args) {
// TODO Auto-generated method stub
Session sess = null;
try {
SessionFactory fact = new
Configuration().configure().buildSessionFactory();
sess = fact.openSession();
String hql = "delete from
Insurance insurance where id = 2";
Query query = sess.createQuery(hql);
int row = query.executeUpate();
if (row == 0){
System.out.println("Doesn't deleted any row!");
}
else{
System.out.println("Deleted Row: " + row);
}
sess.close();
}
catch(Exception e){
System.out.println(e.getMessage());
}
}


Top
 Profile  
 
 Post subject: Re: Bug in Hibernate Query Language
PostPosted: Tue Oct 13, 2009 3:53 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
are you getting an error?

_________________
Sanne
http://in.relation.to/


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.