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

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 禹城市| 临潭县| 苍山县| 闽清县| 彭山县| 望江县| 双流县| 宜兰市| 大英县| 阿图什市| 浦城县| 永福县| 两当县| 新闻| 余姚市| 开封县| 西峡县| 新建县| 兴宁市| 万山特区| 淳化县| 深圳市| 韶山市| 仁寿县| 琼中| 洛浦县| 蚌埠市| 文水县| 合阳县| 石狮市| 永宁县| 巴中市| 淅川县| 通州区| 枣庄市| 玛曲县| 河津市| 凌云县| 星座| 公主岭市| 紫阳县|