課程
/后端開發
/Java
/使用Struts2+Hibernate開發學生信息管理功能
用的hibernate5,請問怎么解決?
2016-04-22
源自:使用Struts2+Hibernate開發學生信息管理功能 2-3
正在回答
@Override public?boolean?usersLogin(Users?u)?{ //?TODO?Auto-generated?method?stub Transaction?tx?=?null; String?sql?=?""; try?{ Session?session?=?MyHibernateSessionFactory.getSessionFactory().getCurrentSession(); tx?=?session.beginTransaction(); sql?=?"select?*?from?users?where?username=??and?password=??"; Query?query?=?session.createSQLQuery(sql); query.setParameter(0,?u.getUsername()); query.setParameter(1,?u.getPassword()); List?list?=?query.list(); tx.commit(); if?(list.size()?>?0)?{ return?true; }?else?{ return?false; } }? catch?(Exception?ex)?{ ex.printStackTrace(); return?false; }? finally?{ if?(tx?!=?null)?{ //?tx.commit(); tx?=?null; } } }
映射關系沒有配置好。檢查struts.xml
qq_張狂與自由_0 提問者
舉報
Strust2+Hibernate整合開發案例,Java Web開發技能更上一層樓
2 回答Users is not mapped?
1 回答Users is not mapped
1 回答報錯了~~Users is not mapped
13 回答Users is not mapped 網上查了好多也沒解決
3 回答Students is not mapped [from Students]
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-04-19
2016-04-22
映射關系沒有配置好。檢查struts.xml