怎么在hibernate 中执行一个update的sql语句
/**
* 执行非查询sql
* @param sql
*/
public void executesql(string sql){
final string tempsql = sql;
this.gethibernatetemplate().execute(new hibernatecallback()
{
public object doinhibernate(session session)
throws hibernateexception
{
session.createsqlquery(tempsql).executeupdate();
return null;
}
});
}