05 2014 档案
摘要:1、下载 nginx 下载页面 : http://nginx.org/en/download.html 具体文件: http://nginx.org/download/nginx-1.7.0.zip 2、运行 nginx 解压第一步下载的 nginx-1.7.0.zip 压缩包 解压到 c:...
阅读全文
摘要:1、初始数据@Test public void test01() { Session session = null; try { session = HibernateUtil.getSessionFactory().openSession(); session.beginTransac...
阅读全文
摘要:1、一对一 (One to One) 共三种情况: 1.1 主键共享 1.2 外键共享 1.3 中间表关联1.1 code:@Entitypublic class article { @Id @GeneratedValue public Integer getArticleId() ...
阅读全文
摘要:参考:http://docs.jboss.org/hibernate/annotations/3.4/reference/zh_cn/html_single/1、系统配置: 可以通过使用 mapping的 resource,于class 属性混合配置在创建SessionFactory 也可以通过代码...
阅读全文
摘要:1、One To One 单相背景: 古代一个老婆 只能关联一个老公husband.javapackage com.rhythmk.model;public class husband { public Integer getHusbandId() { return husbandId; }...
阅读全文
摘要:1、项目结构: 1.1、场景说明: 一个订单,包含多个产品1.2、类文件: Order.javapackage com.rhythmk.model;import java.util.Date;public class Order { public int getOrderID() { re...
阅读全文
摘要:1、安装JBoos Tool Help -> Install new Software 然后添加:http://download.jboss.org/jbosstools/updates/developmenthttp://download.jboss.org/jbosstools/updates...
阅读全文
摘要:Hibernate 加载数据 有get,跟Load 1、懒加载: 使用session.load(type,id)获取对象,并不读取数据库,只有在使用返回对象值才正真去查询数据库。@Test public void test1() { Session session = null;...
阅读全文
摘要:by:rhythmk.cnblogs.com1、Hibernate 三种状态: 1.1、三种定义(个人理解,不一定准确): 瞬时状态(transient): 不被session接管,且不存在数据库中的对象的状态,类似于新New一个对象 离线状态 (detached): 数据库中存在...
阅读全文
摘要:1、环境: Maven :3.1.1 开发工具:Spring Tool Suite 数据库 : Mysql 5.62、项目文件结构文件代码:2.1 、pom.xml 4.0.0 hibernate hibernate 0.0.1-SNAPSHOT jar hibe...
阅读全文