hibernate实现登陆-增删改查-导出excel(Hibernate achieve landing - additions and deletions to change - export Excel).docVIP
- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
hibernate实现登陆-增删改查-导出excel(Hibernate achieve landing - additions and deletions to change - export Excel)
hibernate实现登陆-增删改查-导出excel(Hibernate achieve landing - additions and deletions to change - export Excel)
Hibernate achieve landing - additions and deletions to change - export Excel
Package com.oa.myaffairs.dao.impl;
Import java.util.List;
Import java.util.Map;
Import org.hibernate.Criteria;
Import org.hibernate.SQLQuery;
Import org.hibernate.Session;
Import org.hibernate.Transaction;
Import com.oa.factory.HibernateSessionFactory;
Import com.oa.myaffairs.bean.*;
Import com.oa.systemmanage.bean.Unit;
Public, class, CompanyGroupDaoImpl {
/ / landing
Public, static, Boolean, login (String, name, String, PWD) {
Boolean flag = false;
{try
Session = HibernateSessionFactory.getSession ();
Transaction tran = session.beginTransaction ();
Query q = session
.createQuery (select new User1 (ID) from User1 where name=: name and pwd=: PWD);
Q.setString (name, name);
Q.setString (PWD, PWD);
If (q.list (),.Size () = = 0) {
Flag = true;
}
Tmit ();
} catch (Exception, e) {
E.printStackTrace ();
} finally {
HibernateSessionFactory.closeSession ();
}
Return flag;
}
/ / display list
Public, ListCompanygroup, list (Map, map) {
Session sess = HibernateSessionFactory.getSession ();
Criteria C = sess.createCriteria (Companygroup.class);
C.setFirstResult ((Integer) map.get (start));
C.setMaxResults ((Integer) map.get (pageSize));
List list = c.List ();
Return list;
}
/ / add
Public, void, add (Companygroup, c) {
Session sess = HibernateSessionFactory.getSession ();
Transaction TX = sess.beginTransaction ();
Sess.save (C);
Tmit ();
Sess.close ();
}
/ / modify (according to ID modified)
Public, void, edit (Companygroup, CG) {
Session sess = HibernateSessionFactory.getSession ();
Transaction TX = sess.beginTransaction ();
Sess.update (CG);
Tmit ();
Sess.close ();
}
/ / delete (press ID to delete)
Public, void, del (Integer, ID) {
Session sess = HibernateSessionFactory.getSession ();
Transaction TX = sess.beginTransaction ();
Sess.delete (sess.get (Companygroup.class, ID));
Tmit ();
Sess.close ()
您可能关注的文档
- 2013华东政法(2013 East China politics and law).doc
- 2013各校考研交流群(2013 school entrance examination exchange group).doc
- 2013年12月13日陈磊高一英语公益网络辅导课课堂笔记整理(In December 13, 2013, Chen Lei high school English public network tutorial class notes finishing).doc
- 2013年12月英语四级改革新题型模拟题(五)(In December 2013, English four level reform, new type question simulation question (five)).doc
- 2013年3月中国轿车销量排行榜(Car sales in China in March 2013).doc
- 2013年4月中国汽车销量(Car sales in China in April 2013).doc
- 2013年上半年计划生育工作总结(Summary of family planning work in the first half of 2013).doc
- 2013年12月27日陈磊高一英语公益网络辅导课课堂笔记整理(In December 27, 2013, Chen Lei high school English public network tutorial class notes finishing).doc
- 2013秋华东理工管理心理学1(2013 autumn East China Science and engineering management psychology 1).doc
- 2013年2月德国柏林国际服装及面辅料博览会(Berlin international clothing and accessories fair, February 2013).doc
- hr,一个从一而终式的职业(HR, a simple type of occupation).doc
- hr bar第六管理届大型公益论坛即将全程微博直播(HR bar sixth management session of the large public forum, the upcoming full micro-blog live).doc
- hr,一个从一而终企业培训式的职业(HR, a single enterprise training type of occupation).doc
- hr bar第六管理届大型公益论坛(HR bar sixth management forum for large public welfare).doc
- hrm实战-绩效管理优秀与平庸的分水岭(HRM actual combat - Performance Management the watershed of excellence and mediocrity).doc
- hr变革之前如何发现企业培训并处理风险(How do you find business training and deal with risks before HR change).doc
- hr如何执行薪酬激励管理(How does HR implement salary incentive management).doc
- hr筛选简历技巧(HR screening resume skills).doc
- html元素表(HTML element table).doc
- html元素(html element).doc
文档评论(0)