文章分类 -  Hibernate

摘要: 阅读全文
posted @ 2016-08-20 11:17 乱世_独自美 阅读(103) 评论(0) 推荐(0)
摘要:<!-- Enable Hibernate's automatic session context management --> <property name="current_session_context_class">thread</property> <property name="cach 阅读全文
posted @ 2016-08-20 10:42 乱世_独自美 阅读(83) 评论(0) 推荐(0)
摘要:Hibernate中No row with the given identifier exists问题的原因及解决 产生此问题的原因: 有两张表,table1和table2.产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-one unique="true">( 阅读全文
posted @ 2016-08-03 16:50 乱世_独自美 阅读(1078) 评论(0) 推荐(0)
摘要:数据库中的表一般都是相互关联的,它们通过foreign key产生关系。 定义foreign key约束时可以指定三种引用行为:delete cascade、delete set null、delete no action,默认是delete on action。它们的含义是: 1、delete c 阅读全文
posted @ 2016-07-13 16:07 乱世_独自美 阅读(769) 评论(0) 推荐(0)
摘要:hibernate的session获取: creatQuery() 查询所有 阅读全文
posted @ 2016-07-13 12:29 乱世_独自美 阅读(76) 评论(0) 推荐(0)
摘要:table1和table2是一对一的关系,配置如下: table1.hbm.xml table1 class table2.hbm.xml table2 class 阅读全文
posted @ 2016-07-06 22:11 乱世_独自美 阅读(71) 评论(0) 推荐(0)
摘要:Criterion(标准):将多个参数封装在集合DetachedCriteria对象中,进行分页/或无分页的查询操作 阅读全文
posted @ 2016-07-04 12:57 乱世_独自美 阅读(242) 评论(0) 推荐(0)