Cool eye

          BlogJava 首頁 新隨筆 聯(lián)系 聚合 管理
            63 Posts :: 4 Stories :: 3 Comments :: 0 Trackbacks
          In Hibernate 3.0, we can't use chinese character in HQL statement, if you do that, when The Hibernate  convert HQL statement to Sql statement , The chinese character will be converted to  ???, So you will get uncorrect data from database.
          But we can do this, we use ? code to instead of chinese character, then use find(statement,arguments[]) to get data from database.for example:
          String sql = "select user,org  from HrUsers user,OrgPerson person,OrgOupersonrelation relation,OrgOu org where user.id = person.id and person.id = relation.Pguid and relation.OuGuid = org.id and user.usrName like ?"
          this.getCommonDAO().find(sql,"%"+user.getUsrName()+"%");
          posted on 2006-01-06 15:10 joeyeezhang 閱讀(275) 評(píng)論(0)  編輯  收藏 所屬分類: Hibernate

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 曲周县| 定安县| 高唐县| 巴马| 南皮县| 日喀则市| 潮安县| 昔阳县| 新野县| 晴隆县| 临洮县| 方山县| 宁国市| 根河市| 桐乡市| 平和县| 出国| 隆德县| 宁南县| 泰和县| 固安县| 金川县| 句容市| 泸水县| 达拉特旗| 灵石县| 岳阳县| 贺兰县| 科尔| 枞阳县| 芒康县| 东光县| 卢氏县| 秀山| 巢湖市| 濮阳市| 汶川县| 米泉市| 木里| 三原县| 宁强县|