日期:2014-05-16 浏览次数:20588 次
/**
* 修改指定流程下的节点内容
* @param lcbh
* @param lcmc
* @param oldJdbh
* @param oldJdmc
* @param newJdbh
* @param newJdmc
* @return
* @throws Exception
*/
public boolean updateLcjdDb(String lcbh,String lcmc,String oldJdbh,String oldJdmc,String newJdbh,String newJdmc) throws Exception {
Session session = this.getSession();
Transaction tx =null;
String hql="update BFsYwbd set jdph=?,jdmc=? where lcph=? and lcmc=? and jdph=? and jdmc=?";
int count=0;
try{
tx = session.beginTransaction();
Query query=this.getSession().createQuery(hql);
query.setString(0, newJdbh);
query.setString(1, newJdmc);
query.setString(2, lcbh);
query.setString(3, lcmc);
query.setString(4, oldJdbh);
query.setString(5, oldJdmc);
count=query.executeUpdate();
tx.commit();
session.flush();
}catch(Exception e){
tx.rollback();
throw e;
}
return count>=1?true:false;
}
/**
* 修改指定流程下的节点内容
* @param lcbh
* @param lcmc
* @param oldJdbh
* @param oldJdmc
* @param newJdbh
* @param newJdmc
* @return
* @throws Exception
*/
public boolean updateLcjdDb(String lcbh,String lcmc,String oldJdbh,String oldJdmc,String newJdbh,String newJdmc) throws Exception {
Session session = this.getHibernateTemplate().getSessionFactory().openSession();
Transaction tx =null;
String hql="update BFsYwbd set jdph=?,jdmc=? where lcph=? and lcmc=? and jdph=? and jdmc=?";
int count=0;
try{
tx = session.beginTransaction();
Query query=this.getSession().createQuery(hql);
query.setString(0, newJdbh);
query.setString(1, newJdmc);
query.setString(2, lcbh);
query.setString(3, lcmc);
query.setString(4, oldJdbh);
query.setString(5, oldJdmc);
count=query.executeUpdate();
tx.commit();
session.flush();
}catch(Exception e){
tx.rollback();
throw e;
}
return count>=1?true:false;
}