该文被密码保护。 阅读全文
posted @ 2013-01-24 21:46 xzf007 阅读(1) 评论(0) 推荐(0) 编辑
摘要: OSCache可以支持中央缓存要想支持缓存hibernate.cfg.xml应该做如下配置:<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hiberna 阅读全文
posted @ 2012-08-30 21:11 xzf007 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1、Hibernate对于集合不区分空集和null,也就是说下面这两种情况在Hibernate里面是一样的:Collection c = new ArrayList();//c != nullCollection c1 = null; 阅读全文
posted @ 2012-08-30 17:43 xzf007 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 类与表的关系:*************Employee.java*************package blog.hibernate.domain; public class Employee { private int id; private String name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { re... 阅读全文
posted @ 2012-08-27 17:39 xzf007 阅读(645) 评论(0) 推荐(0) 编辑
摘要: 类和表的关系:单独使用<subclass/>元素的类会和父类在同一张表里;使用<subclass><join></join></subclass>这两个元素的类会单独占一个表。*************Employee.java*************package blog.hibernate.domain; public class Employee { private int id; private String name; public int getId() { return id; } public void setI. 阅读全文
posted @ 2012-08-27 16:31 xzf007 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 类与表的关系:*************Employee.java*************package blog.hibernate.domain; public class Employee { private int id; private String name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { re... 阅读全文
posted @ 2012-08-26 22:12 xzf007 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 类与表的关系:*************Employee.java*************package blog.hibernate.domain; public class Employee { private int id; private String name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { re... 阅读全文
posted @ 2012-08-26 21:47 xzf007 阅读(279) 评论(0) 推荐(0) 编辑
摘要: ***************Student.java***************package blog.hibernate.domain; import java.util.ArrayList; import java.util.List; public class Student { private int id; private String name; private List<Teacher> teachers = new ArrayList<Teacher>(); public List<Teacher> getTeachers() { .. 阅读全文
posted @ 2012-08-26 11:07 xzf007 阅读(352) 评论(0) 推荐(0) 编辑
摘要: ****************hibernate.cfg.xml***************<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hiber 阅读全文
posted @ 2012-08-25 21:25 xzf007 阅读(411) 评论(0) 推荐(0) 编辑
摘要: ***************Teacher.java***************package blog.hibernate.domain; import java.util.HashMap; import java.util.List; import java.util.Map; public class Teacher { private int id; private String name; private String course; private Map<String, Student> students = new HashMap<S... 阅读全文
posted @ 2012-08-25 17:48 xzf007 阅读(194) 评论(0) 推荐(0) 编辑