zoukankan      html  css  js  c++  java
  • hib 传参数


    String   hqlDelete   =   "delete   EaccountForm   where   serial_no_ecustomer   =   :serial_no_ecustomer   ";  
                      int   deletedEntities   =   session.createQuery(   hqlDelete   )  
                                                              .setString(   "serial_no_ecustomer",   serial_no_ecustomer   )                                                        
                                                              .executeUpdate();
                                                             
                                                             
    //以条件来区分的  
      String   hql="delete   from   User   where   age   <   18   ";  
      session.createQuery(hql).executeUpdate();  
       
      //多个ID的  
      String   hql="delete   form   User   where   id   in   :idd";  
      session.createQuery(hql).setParameterList("idd",idd_list).executeUpdate();       
     

    Object[] obj={"%"+typeName+"%",new Integer(flgDelete)};
    return (List) getHibernateTemplate().find("from Type t where t.name like ? and t.flgDelete=?",obj);

    con = HibernateConnectionManager.getConnection();
                //SELECT id FROM SYS_USER WHERE (group_id = ? OR '0' = ?) AND (logon_id LIKE ? OR NAME LIKE ?) ORDER BY priority
                pstmt = con.prepareStatement(QUERY_USER);
                pstmt.setString(1, groupID);
                pstmt.setString(2, groupID);
                pstmt.setString(3, "%" + key + "%");
                pstmt.setString(4, "%" + key + "%");

    public List<Dictionary> search(Map<String, String[]> param) {
      String hql = "from Dictionary as dic where dic.name like :name and dic.code like :code ";
      Map<String, Object> paramsM = new HashMap();
      //字典字典码
      String code = getParameter(param, "code");
      paramsM.put("code", code==null?"":("%"+code+"%"));  
      //字典名称
      String name = getParameter(param, "name");
      paramsM.put("name", name==null?"":("%"+name+"%"));         

    select * from oa_org_action_uims
    where action_time >= to_date('2007-9-4 17:15:39','yyyy_mm_dd HH24:MI:SS')

     Query updateQuery=this.getSession().createQuery(hql.toString());
      updateQuery.setString(0, researchId);
      updateQuery.setString(1, researchId);
      
      updateQuery.executeUpdate();

    StringBuffer hql = new StringBuffer(
        "delete from SampleLibTempAddResult s where s.sampleid in(:ids) and s.batchid=:batchid ");
      
      Query updateQuery=this.getSession().createQuery(hql.toString());
      
      updateQuery.setParameterList("ids", ids);
      updateQuery.setParameter("batchid", batchId, Hibernate.STRING);
      updateQuery.executeUpdate();

  • 相关阅读:
    iOS Touch ID 身份认证
    iOS 真机测试错误“The application could not be verified”
    iOS 容器控制器 (Container View Controller)
    cocos creator按钮点击按钮弹起效果设置方法
    coco creator编辑动画坑之拖图片
    cocos动画没有cc.Sprite.spriteFrame属性
    cocos发布遇到的问题
    Android数据库GreenDao配置版本问题
    Android写入文件电脑看不到
    如何保证WebBrowser一直在页面内跳转
  • 原文地址:https://www.cnblogs.com/rattersnake/p/3055995.html
Copyright © 2011-2022 走看看