public int updateByHql ( String secondHalfOfHql , Object [ ] paramValues , Type [ ] paramTypes ) { StringBuilder queryStr = new StringBuilder ( ) ; queryStr . append ( "update " ) . append ( this . clazz . getName ( ) ) . append ( " " ) ; if ( secondHalfOfHql != null ) { queryStr . append ( secondHalfOfHql ) ; } Session session = this . getCurrentSession ( ) ; Query query = session . createQuery ( queryStr . toString ( ) ) ; setupQuery ( query , paramValues , paramTypes , null , null ) ; return query . executeUpdate ( ) ; }
Update by criteria specified as HQL