![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Hibernate
laten128
这个作者很懒,什么都没留下…
展开
-
Hibernate学习之一-------数据库连接的模板类
用myeclipse生成的一个产生数据库连接的模板类,很经典,值得学习:package com.zhsh.hibernate.util;import org.hibernate.HibernateException;import org.hibernate.Session;import org.hibernate.cfg.Configuration;/** * Co...2009-11-25 15:57:36 · 65 阅读 · 0 评论 -
Hibernate学习之二-------搭建环境时应注意的地方
1.使用的库的版本:Hibernate Core 3.2.4. Myeclipse 7.5中自带的.需要用到的jar包有: 不同的版本用到的包会不一样,也有可能出现包冲突的问题。当使用Hibernate 3.3.2 ga时,将lib下面的required中的jar包和Hibernate.jar加到类路径中时,此时运行是会出现异常:找不到一个类。这是由于还少了一个jar包:slf4...2009-11-26 08:58:39 · 77 阅读 · 0 评论 -
Hibernate学习之三-------异常与错误
1.org.hibernate.hql.ast.QuerySyntaxException: XXX is not mapped [from XXX] from XXX 这里的XXX是类名,而不是table的名字出现这种异常时:(1)检查hibernate.cfg.xml中是否有<mapping resource="com/zhsh/hibernate/entity/XXX....2009-11-26 15:44:04 · 65 阅读 · 0 评论 -
正确理解hibernate的inverse,双向关联
在hibernate中是通过inverse的设置来决定是有谁来维护表和表之间的关系的最近有朋友问我hibernate关于多对多关于删除中间表数据的问题,关键是inverse的设置.下面引用网友的一篇文章Inverse是hibernate双向关系中的基本概念,当然对于多数实体,我们并不需要双向关联,更多的可能会选择单向关联,况且我们大多数人一般采用一对多关系,而一对多双向关联的另一端:多对一...原创 2009-11-26 17:30:29 · 80 阅读 · 0 评论 -
Hibernate学习之四-------The Persistence Life Cycle
1. Life CycleGiven an instance of an object that is mapped to Hibernate, it can be in any one of three different states: transient, persistent, or detached.映射到Hibernate中的类可以是以下三种状态中的一种:瞬时的,持久的,分离...2009-11-27 10:08:36 · 89 阅读 · 0 评论 -
深入浅出hibernate读书笔记一
1.Hibernate高级映射技术【1】 自定义数据类型 Package org.hibernate.usertype Interface :UserType CompositeUserType【2】 复合主键 Composite-id【3】 Blob Clob字段的映射Blob字段采用单字节存储,适合保存二进制数据,如图片文件。Clob字段采用多字节存储,适合保存大型文本数...2009-12-01 14:58:17 · 202 阅读 · 0 评论 -
Hibernate学习之六-------Session,Query
一.Session 1.Session介绍,作用,使用 The main runtime interface between a Java application and Hibernate. This is the central API class abstracting the notion of a persistence service.The lifecycle of ...2009-12-01 17:19:34 · 166 阅读 · 0 评论 -
Restrictions HQL QBC
HQL运算符QBC运算符含义=Restrictions.eq()等于equal<> Restrictions.ne()不等于not equal> Restrictions.gt()大于greater than>...2010-04-13 00:43:26 · 354 阅读 · 0 评论