Cool eye

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            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) 評論(0)  編輯  收藏 所屬分類: Hibernate

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 镇平县| 紫阳县| 三原县| 化德县| 原阳县| 通渭县| 垦利县| 华蓥市| 于田县| 女性| 河北区| 民权县| 和平区| 青龙| 台南市| 河津市| 乌拉特后旗| 台江县| 景泰县| 高平市| 荃湾区| 茶陵县| 衢州市| 南投县| 宁陵县| 布尔津县| 犍为县| 兰西县| 冷水江市| 醴陵市| 陕西省| 和平区| 济宁市| 富民县| 杭州市| 五河县| 应城市| 梁平县| 徐闻县| 长寿区| 铜川市|