hibernate
qq_39010381
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
SpringMVC集成Hibernate的主要配置
主要的架包支持pom.xml[html] view plain copyproject xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://m转载 2017-07-03 10:53:46 · 506 阅读 · 0 评论 -
Hibernate的二级缓存和查询缓存
架包ehcache-core-2.4.3.jarhibernate-ehcache-4.2.20.Final.jarslf4j-api-1.6.1.jarpom.xml[html] view plain copydependency> groupId>net.sf.ehcacheg转载 2017-07-04 10:09:51 · 184 阅读 · 0 评论 -
Hibernate的关系映射
Dept[java] view plain copypackage cn.et.hibernate.lesson02.relation; import java.util.HashSet; import java.util.Set; /** * Dept entity. @author MyEclips转载 2017-07-04 10:11:17 · 168 阅读 · 0 评论 -
Hibernate的load和get
/** * get直接发起sql语句 * get如果查询oid不存在 会返回Null * load使用懒加载(延迟加载)产生是一个代理对象 属性oid * load如果查询oid不存在 会直接抛出异常 */ @Test public void test(){ SessionFactory sf = new Conf转载 2017-07-04 10:12:03 · 175 阅读 · 0 评论 -
Hibernate中对象的三种状态及相互转化
1. 瞬时状态 (Transient)当我们通过Java的new关键字来生成一个实体对象时,这时这个实体对象就处于自由状态,如下: Customer customer=new Customer(“zx”,27,images);这时customer对象就处于自由状态,为什么说customer对象处于自由状态呢?这是因为,此时customer只是通过JVM获得了一块内存转载 2017-07-04 10:12:49 · 184 阅读 · 0 评论 -
Hibernate的初探
先随便新键一个项目生成一个默认的配置文件主要的架包支持pom.xml[html] view plain copyproject xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/200转载 2017-07-04 11:47:29 · 225 阅读 · 0 评论 -
hibernate的查询是懒加载引起的错误
web.xml[html] view plain copyhibernate的查询是懒加载,所以可能导致list对象传到jsp的时候还没有加载数据 这里把session打开,那么在jsp读取数据的时候可以再去数据库查询 --> filter> filter-name>openfilter-name>转载 2017-07-14 09:59:37 · 332 阅读 · 0 评论
分享