锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产一区二区视频,最新亚洲精品,久久人人爽亚洲精品天堂http://www.aygfsteel.com/xiangxiang/zh-cnThu, 07 Aug 2025 23:22:04 GMTThu, 07 Aug 2025 23:22:04 GMT60hibernate鏇存柊鏁版嵁http://www.aygfsteel.com/xiangxiang/archive/2008/09/23/230745.html鎯蟲兂鎯蟲兂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涓嶈兘鐩存帴鐢紝鍥犱負浠栨槸浠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灝辮浜嗐?/p>

鎯蟲兂 2008-09-23 20:12 鍙戣〃璇勮
]]>
甯府鎴戯紝hibernate鐨剆ql鏌ヨ鍑洪敊??? http://www.aygfsteel.com/xiangxiang/archive/2008/09/23/230738.html鎯蟲兂鎯蟲兂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"鏄垪鍚嶃傚叾浣滅敤鏄寜姹夊瓧鐨勫瓧絎︿覆鐨勭涓涓瓧鐨勮嫳鏂囬瀛楁瘝鏌ュ嚭鐩稿簲鐨勫瓧絎︿覆錛堟寜棣栧瓧姣嶆煡璇級銆?
鎴戠敤鐨勬槸List list = session.createSQLQuery(sql)
.addEntity("emp",Employee.class)
.list() ;
鏂規(guī)硶銆?
鎶ョ殑閿欒鏄?list()閭h銆俿ql璇彞鍦ㄦ煡璇㈠垎鏋愬櫒涓瘯榪囦簡錛屾病闂銆傚叿浣撻敊璇唬鐮佸涓嬶細

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瓟銆傝阿璋?

鎯蟲兂 2008-09-23 19:01 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 奉化市| 汪清县| 怀化市| 海原县| 牟定县| 应城市| 深水埗区| 普格县| 彭水| 衡南县| 牡丹江市| 宣威市| 广河县| 克东县| 辽宁省| 宁德市| 涡阳县| 舞钢市| 洮南市| 桐庐县| 满城县| 图木舒克市| 南溪县| 德兴市| 塔河县| 达孜县| 洛宁县| 乐都县| 巢湖市| 肇东市| 安塞县| 闽清县| 安康市| 石狮市| 绿春县| 静海县| 七台河市| 红原县| 盐池县| 海淀区| 铜山县|