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 閱讀(280) 評論(0)  編輯  收藏 所屬分類: Hibernate

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


          網站導航:
           
          主站蜘蛛池模板: 泾源县| 灵石县| 江华| 云梦县| 兴安县| 襄城县| 长兴县| 苍溪县| 龙井市| 威远县| 江川县| 邹平县| 岳池县| 山东| 龙井市| 汝城县| 万山特区| 松江区| 苏尼特左旗| 彭山县| 夹江县| 山东省| 德安县| 张家口市| 克什克腾旗| 班玛县| 香格里拉县| 儋州市| 奉化市| 个旧市| 鹤峰县| 扶余县| 嘉禾县| 股票| 唐河县| 定日县| 东乡| 宿迁市| 社旗县| 文昌市| 广元市|