![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hibernate
timothy0768
这个作者很懒,什么都没留下…
展开
-
Hibernate+ehcache二级缓存技术
1、首先设置EhCache,建立配置文件ehcache.xml,默认的位置在class-path,可以放到你的src目录下: <?xml version="1.0" encoding="UTF-8"?> <ehcache> <diskStore path="java.io.tmpdir"/> ...2007-04-29 10:11:46 · 68 阅读 · 0 评论 -
Hibernate fetch lazy cascade inverse
从网上copy 一篇文章 Hibernate最让人头大的就是对集合的加载形式。 书看了N次了,还是没有真正理解Hibernate。所以下午专门做了下测试,对配置文件的意思加深了认识。 假设有两个表,Photos(一) --- picture(多)Photo包含picture集合 结论1: HQL代码 > fetch(配置) > lazy (配置) 结论2: 默认 lazy=...2007-04-29 13:14:19 · 93 阅读 · 0 评论 -
hibernate id 转自:
xml 代码 <id name=”id” column=”id” type=”java.lang.Integer”> <generator class=”native”/> id> 上面是一个简单的id映射配置,id属性对应映射类中的属性,column对应数据库中表字段。 重点是这个generator...2007-05-08 14:13:36 · 91 阅读 · 0 评论 -
Session的中文翻译 转自:
org.hibernate Interface Session All Superinterfaces: Serializable All Known Subinterfaces: EventSource, Session All Known Implementing Classes: SessionImpl public interface Session extends Serializab...2007-05-09 16:10:32 · 1410 阅读 · 0 评论 -
No CurrentSessionContext
使用 SessionFactory.getCurrentSession()时,需要设置相应的transaction管理。 否则会出现错误: org.hibernate.HibernateExcepti...2007-05-16 14:45:53 · 98 阅读 · 0 评论 -
HibernateUtil
java 代码 import org.hibernate.*; import org.hibernate.cfg.*; public class HibernateUtil { private static SessionFactory sessionFactory; static { ...2007-09-03 13:54:29 · 89 阅读 · 0 评论