Hibernate
iteye_19538
这个作者很懒,什么都没留下…
展开
-
Spring HibernateTemplate getHibernateTemplate()
一、find(String queryString); 示例:this.getHibernateTemplate().find("from bean.User"); 返回所有User对象 二、find(String queryString , Object value); 示例:this.getHibernateTemplate().fin...原创 2010-09-27 18:27:40 · 115 阅读 · 0 评论 -
org.hibernate.HibernateException: Illegal attempt to associate a collection with
org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions 在ApplicationContext.xml 中的Action中加入 scope="prototype" <bean id="insertFamerAction" class="c...原创 2010-09-28 18:19:39 · 145 阅读 · 0 评论 -
oracle sequence 在Hibernate中应用
1、在Oracle sequence首先创建sequence create sequence seq_id minvalue 1 start with 1 increment by 1 cache 20; 2.在你的hbm.xml中的配置 <id column="ID0000" na...原创 2010-09-28 18:55:34 · 54 阅读 · 0 评论 -
使用连接表的单向关联【一对多(one-to-many)】
基于连接表的单向一对多关联 应该优先被采用。请注意,通过指定unique="true",我们可以把多样性从多对多改变为一对多。 person.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping...原创 2010-10-15 16:49:52 · 158 阅读 · 0 评论