欢迎来到天天文库
浏览记录
ID:9371112
大小:311.00 KB
页数:59页
时间:2018-04-29
《《web系统开发课程设计》》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、信息科学与技术学院《Web系统开发课程设计》实训报告书题目:Web系统开发课程设计专业:信息管理与信息系统班级:姓名:学号:指导老师:设计时间:2017年5月15日~2017年5月19日第一天一、学习内容1)软件安装(myEclipse10.0、mysql5.1+navicat、Tomcat7.0)2)Hibernate的基本配置和核心文件、关系映射文件回顾3)单表操作和多对多的操作4)Hibernate级联查询(自连接左外连接右外连接)二、学习代码1.User.javapackagecom.itedu.entity;publicclassUser{privateIntegerid;p
2、rivateStringusername;privateStringpassword;privateStringalias;//描述publicUser(Integerid,Stringusername,Stringpassword,Stringalias){super();this.id=id;this.username=username;this.password=password;this.alias=alias;}publicUser(){super();}publicIntegergetId(){returnid;}publicvoidsetId(Integerid){thi
3、s.id=id;}publicStringgetUsername(){returnusername;}publicvoidsetUsername(Stringusername){this.username=username;}publicStringgetPassword(){returnpassword;}publicvoidsetPassword(Stringpassword){this.password=password;}publicStringgetAlias(){returnalias;}publicvoidsetAlias(Stringalias){this.alias=
4、alias;}publicStringtoString(){return"User[id="+id+",username="+username+",password="+password+",alias="+alias+"]";}}2.User.hbm.xml5、ng>6、bernate-mapping>3.HibernateTest.javapackagecom.itedu.hibernatetest;importorg.hibernate.Session;importorg.hibernate.SessionFactory;importorg.hibernate.Transaction;importorg.hibernate.cfg.Configuration;importorg.junit.Test;importcom.itedu.entity.User;publicclassHibernateTest{publicvoidtest(){//1.加7、载ConfigurationConfigurationcf=newConfiguration();cf.configure();//2.先拿到sessionFactorySessionFactorysf=cf.buildSessionFactory();//3.seesionCRUD操作Sessionsession=sf.openSession();Transactiontx=session.beginTransaction();//4.开启事
5、ng>6、bernate-mapping>3.HibernateTest.javapackagecom.itedu.hibernatetest;importorg.hibernate.Session;importorg.hibernate.SessionFactory;importorg.hibernate.Transaction;importorg.hibernate.cfg.Configuration;importorg.junit.Test;importcom.itedu.entity.User;publicclassHibernateTest{publicvoidtest(){//1.加7、载ConfigurationConfigurationcf=newConfiguration();cf.configure();//2.先拿到sessionFactorySessionFactorysf=cf.buildSessionFactory();//3.seesionCRUD操作Sessionsession=sf.openSession();Transactiontx=session.beginTransaction();//4.开启事
6、bernate-mapping>3.HibernateTest.javapackagecom.itedu.hibernatetest;importorg.hibernate.Session;importorg.hibernate.SessionFactory;importorg.hibernate.Transaction;importorg.hibernate.cfg.Configuration;importorg.junit.Test;importcom.itedu.entity.User;publicclassHibernateTest{publicvoidtest(){//1.加
7、载ConfigurationConfigurationcf=newConfiguration();cf.configure();//2.先拿到sessionFactorySessionFactorysf=cf.buildSessionFactory();//3.seesionCRUD操作Sessionsession=sf.openSession();Transactiontx=session.beginTransaction();//4.开启事
此文档下载收益归作者所有