Java Code Examples for org.hibernate.SQLQuery#setString()

The following examples show how to use org.hibernate.SQLQuery#setString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QuestionDaoImpl.java    From DWSurvey with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 更新orderbyId
 * 属性 belongId所有题目,只要大于等于orderById+1
 * @param belongId
 * @param orderById
 */
private void quOrderByIdAdd1(String belongId,Integer orderById){
	if(belongId!=null && !"".equals(belongId)){
		String sql="update t_question set order_by_id=order_by_id+1 where belong_id=? and order_by_id>=?";
		//更新排序号
		SQLQuery query=this.getSession().createSQLQuery(sql);
		query.setString(0, belongId);
		query.setInteger(1, orderById);
		query.executeUpdate();
	}
}
 
Example 2
Source File: QuestionDaoImpl.java    From DWSurvey with GNU Affero General Public License v3.0 5 votes vote down vote up
public void quOrderByIdDel1(String belongId,Integer orderById){
	if(belongId!=null && !"".equals(belongId)){
		String sql="update t_question set order_by_id=order_by_id-1 where belong_id=? and order_by_id>=?";
		//更新排序号
		SQLQuery query=this.getSession().createSQLQuery(sql);
		query.setString(0, belongId);
		query.setInteger(1, orderById);
		query.executeUpdate();
	}
}
 
Example 3
Source File: QuRadioDaoImpl.java    From DWSurvey with GNU Affero General Public License v3.0 5 votes vote down vote up
public void quOrderByIdDel1(String quId,Integer orderById){
	if(quId!=null && !"".equals(quId)){
		String sql="update t_qu_radio set order_by_id=order_by_id-1 where qu_id=? and order_by_id>=?";
		//更新排序号
		SQLQuery query=this.getSession().createSQLQuery(sql);
		query.setString(0, quId);
		query.setInteger(1, orderById);
		query.executeUpdate();
	}
}