1、Session对象的方法 :
get() save() update(get()) delete()
2、数据的状态 : 持久态,瞬时态,游离态
3、hibernate框架搭建中出现的异常信息 :
(1)错误:Exception in thread "main" org.hibernate.HibernateException: Error applying BeanValidation relational constraints
处理:在hibernate.cfg.xml中添加<property name="javax.persistence.validation.mode">none</property>
(2)错误:Exception in thread "main" java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I
处理:(struts下antlr2.7.2.jar和hibernate下的antlr2.7.7.jar包冲突)
在window->pre
(3)错误:配置文件hibernate.cfg.xml 没有关联实体
处理:有两种的情况 : xml配置文件的情况下 :mapping标签要关联到xml文件
annotation注解的情况下:mapping标签要关联到entity实体类
(4)错误:Reading mappings from resource: com/xmu/house/entity/UserInfo.hbm.xml
处理:删除UserInfo.hbm.xml中dtd后面的空格
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd ">
(5)错误:获取不到用户对象包含的房屋对象
处理:获取对象中的成员对象须用session会话!!将对象转变为持久态,才可以级联获取其成员对象