HIbernate整理材料.docVIP

  • 1
  • 0
  • 约1.09万字
  • 约 7页
  • 2017-01-07 发布于上海
  • 举报
HIbernate整理材料

二、简答题: 1.正常访问数据库时事务的执行顺序(图)? P64 2.Hibernate主键生成的方式有几种? (Hibernate的内置标识符生成器) P128、P134 3.怎么理解session缓存,其优点是什么?P180 P182(三大作用) 4.session怎样找到数据、找到的数据怎样放到session缓冲中(图)?P183(两个图) 5.Hibernate持久化层的几种状态? P187(三种) 6.Hibernate的核心接口有哪几种?分别具有什么特点? P39—P41 Configuration、SessionFactory、Session、Transaction、Query和Criteria 7.Hibernate的几种检索方式? P413(三种:HQL、QBC、SQL) 8.HQL有哪些功能? P416 9.HQL与SQL在本质上区别? P417(不一样) 10.QBC检索方式的步骤? P418 11.在java应用中使用Hibernate包含哪几个步骤? P47 三、编程题 单表 hibernate.cfg.xml ?xml version=1.0 encoding=UTF-8? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD 3.0//EN /hibernate-configuration-3.0.dtd !-- Generated by MyEclipse Hibernate Tools. -- hibernate-configuration session-factory property name=connection.usernameroot/property property name=connection.url jdbc:mysql://localhost:3306/user(user是数据库名,看好在写) /property property name=dialect org.hibernate.dialect.MySQLDialect /property property name=filemysql/property property name=connection.password123456/property property name=connection.driver_class com.mysql.jdbc.Driver (这两处加粗的mysql是在数据库视图中,新建连接时所起的名字) /property mapping resource=com/mysoft/pojo/MyUser.hbm.xml / (com/mysoft/pojo/是MyUser.hbm.xml所在的包,MyUser是表名) /session-factory /hibernate-configuration MyUser.hbm.xml ?xml version=1.0 encoding=utf-8? !DOCTYPE hibernate-mapping PUBLIC -//Hibernate/Hibernate Mapping DTD 3.0//EN /hibernate-mapping-3.0.dtd !-- Mapping file autogenerated by MyEclipse Persistence Tools -- hibernate-mapping class name=com.mysoft.pojo.MyUser table=my_user catalog=user id name=userId type=java.lang.Integer column name=user_id / generator class=native / /id property name=userName type=java.lang.String column name=user_name length=20 not-null=true / /property property name=userPass type=java.lang.String column name=user_pass length=20 not-null=true /

文档评论(0)

1亿VIP精品文档

相关文档