Code example for Session

Methods: createQuery

0
 
			final String queryString = "delete from RoleFunctionM as rfm where rfm.roleid=:roleid";
			this.getHibernateTemplate().execute(new HibernateCallback() {
 
				public Object doInHibernate(Session session) throws HibernateException, SQLException {
					Query query = session.createQuery(queryString);
					int i = 0;
					query.setParameter("roleid", roleid);
					i = query.executeUpdate();
					return i;
				} 
			}); 
		} catch (RuntimeException re) {
			log.error("delFunctionM failed", re);
			throw re;
		} 
		return 0; 
	} 
	 
	 
Contextual code suggestions in your IDE  Get Codota for Java