锘??xml version="1.0" encoding="utf-8" standalone="yes"?>绯色av一区二区,www.日韩,国产成人在线视频网站http://www.aygfsteel.com/xiangxiang/zh-cnThu, 07 Aug 2025 23:25:08 GMTThu, 07 Aug 2025 23:25:08 GMT60hibernate鏇存柊鏁版嵁http://www.aygfsteel.com/xiangxiang/archive/2008/09/23/230745.html鎯蟲(chóng)兂鎯蟲(chóng)兂Tue, 23 Sep 2008 12:12:00 GMThttp://www.aygfsteel.com/xiangxiang/archive/2008/09/23/230745.htmlhttp://www.aygfsteel.com/xiangxiang/comments/230745.htmlhttp://www.aygfsteel.com/xiangxiang/archive/2008/09/23/230745.html#Feedback0http://www.aygfsteel.com/xiangxiang/comments/commentRss/230745.htmlhttp://www.aygfsteel.com/xiangxiang/services/trackbacks/230745.htmlsession.update涓嶈兘鐩存帴鐢紝鍥犱負(fù)浠栨槸浠D涓轟富閿紝蹇呴』鏌ヨ鍑篒D鎵嶈兘榪涜鏇存柊銆傘傘?/p>

Usertable user=null;

Session session=HibernateSessionFactory.getSession();
String sql="from Usertable as user where user.username=?";
Query q=session.createQuery(sql);
q.setString(0,username);
List l=q.list();
Iterator ite=l.iterator();
if(ite.hasNext()){
   user=(Usertable)ite.next();
  
}
return user;

鏌ヨ瀹屼互鍚庢墠鑳芥洿鏂扮敤SESSION.UPDATE灝辮浜?jiǎn)銆?/p>

]]>
甯府鎴戯紝hibernate鐨剆ql鏌ヨ鍑洪敊??? http://www.aygfsteel.com/xiangxiang/archive/2008/09/23/230738.html鎯蟲(chóng)兂鎯蟲(chóng)兂Tue, 23 Sep 2008 11:01:00 GMThttp://www.aygfsteel.com/xiangxiang/archive/2008/09/23/230738.htmlhttp://www.aygfsteel.com/xiangxiang/comments/230738.htmlhttp://www.aygfsteel.com/xiangxiang/archive/2008/09/23/230738.html#Feedback2http://www.aygfsteel.com/xiangxiang/comments/commentRss/230738.htmlhttp://www.aygfsteel.com/xiangxiang/services/trackbacks/230738.html 鍦╤ibernate涓煡璇㈡暟鎹?鏌ヨ璇彞涓寘鍚玸ql鍑芥暟String sql = (select * from employee emp where left(dbo.f_GetPy(name,1)='瑕佹煡璇㈢殑瀛楁瘝')
鍏朵腑dbo.f_GetPy(name),1)涓簊ql server 2000涓殑鑷畾涔夊嚱鏁?"name"鏄垪鍚嶃傚叾浣滅敤鏄寜姹夊瓧鐨勫瓧絎︿覆鐨勭涓涓瓧鐨勮嫳鏂囬瀛楁瘝鏌ュ嚭鐩稿簲鐨勫瓧絎︿覆錛堟寜棣栧瓧姣嶆煡璇級(jí)銆?
鎴戠敤鐨勬槸List list = session.createSQLQuery(sql)
.addEntity("emp",Employee.class)
.list() ;
鏂規(guī)硶銆?
鎶ョ殑閿欒鏄?list()閭h銆俿ql璇彞鍦ㄦ煡璇㈠垎鏋愬櫒涓瘯榪囦簡(jiǎn)錛屾病闂銆傚叿浣撻敊璇唬鐮佸涓嬶細(xì)

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: could not execute query
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
yfy.struts.MyActionServlet.process(MyActionServlet.java:17)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

org.hibernate.exception.SQLGrammarException: could not execute query
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
org.hibernate.loader.Loader.doList(Loader.java:2148)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
org.hibernate.loader.Loader.list(Loader.java:2024)
org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:111)
org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1655)
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:164)
yfy.dao.BaseDaoImpl.execSQLQuery(BaseDaoImpl.java:138)
yfy.struts.action.EmpNameListAction.execute(EmpNameListAction.java:40)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
yfy.struts.MyActionServlet.process(MyActionServlet.java:17)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

璇烽珮鎵嬩滑甯垜瑙g瓟銆傝阿璋?

]]>
主站蜘蛛池模板: 英德市| 大渡口区| 诏安县| 平果县| 宁都县| 繁峙县| 修武县| 林周县| 崇信县| 绥棱县| 灵璧县| 肇州县| 滨州市| 古丈县| 顺昌县| 杭州市| 榆社县| 玉树县| 蓬溪县| 长葛市| 满城县| 门源| 曲松县| 民权县| 兴隆县| 张掖市| 资溪县| 大方县| 建阳市| 古蔺县| 凤城市| 华容县| 石景山区| 双峰县| 平安县| 嘉兴市| 东海县| 邹平县| 阳江市| 荆门市| 南城县|