hibernate
普通网友
这个作者很懒,什么都没留下…
展开
-
hibernate 异常处理
ids for this class must be manually assigned before calling save(),User.hbm.xml 中主键生成设置是 hibernate 这个错误的原因可能是,表中已经有个主键(id)。 但是插入的(调用save)时那个值是null User user_ = new User(); //user_.set...2009-03-05 16:01:55 · 168 阅读 · 0 评论 -
hibernate 分页
三个参数,第一个是HQL语句,如from EntryObject第二个是从第几条记录开始 第三个是分页的页显示条数大小 find("from EntryObject",1,20); 表示查询Users 表,从第1条记录开始,共查询出20条记录public List find( final String hsql, final int firstRow...2009-04-25 20:27:38 · 83 阅读 · 0 评论 -
Could not load org.apache.xerces.util.EncodingMa
出现此错误的原因是在hibernate 映射文件中引入了不存在的类名com.cn.common.domain.UserRole 并且存在不必要的映射文件 例如 具体详情如下INFO: Illegal access: this web application instance has...2009-04-20 22:22:13 · 118 阅读 · 0 评论 -
could not load an entity
1.could not load an entity (get)2.23:31:32,468 ERROR LazyInitializationException:19 - could not initialize proxy - the owning Session was closedorg.hibernate.LazyInitializationException: could no...2009-04-19 23:12:48 · 814 阅读 · 0 评论 -
org.springframework.orm.hibernate3.HibernateSystem
出现此错误的愿意是主表,附表 的关联字段问题,附表中的外键与主表中的主键的数据类型不同而引起的20:57:11,578 WARN RequestProcessor:516 - Unhandled Exception thrown: class org.springframework.orm.hibernate3.HibernateSystemException20:57:11,578...2009-04-07 21:04:20 · 206 阅读 · 0 评论 -
org.hibernate.tuple.PojoEntityTuplizer.setProperty
err.org.hibernate.tuple.PojoEntityTuplizer.setPropertybireport表中赋值了一个null值,但是在类型却是java中的元类型(byte、char、int、fload、double)中的一种,java是不允许对这些类型赋值为null的。 java.lang.NullPointerException at com.cn.bi...2009-04-03 18:12:10 · 103 阅读 · 0 评论 -
浅谈对象在Hibernate中的状态
浅谈对象在Hibernate中的状态 =========================================================== 作者: wqbi(http://wqbi.itpub.net)发表于: 2006.05.31 00:07分类: hiberante之旅 出处: [url]http://wqbi.itpub.net/post/2966/10...原创 2009-03-23 19:35:15 · 87 阅读 · 0 评论 -
could not initialize proxy - Session was closed
转自 http://hi.baidu.com/k_boy/blog/item/6ce8f80366d784e808fa93f1.html其实这个异常写的非常之清楚,就是会话关闭,无法对Hibernate实体进行操作。造成这样的情况有很多,什么书写错误啊,逻辑错误啊。但就此说一下关于lazy机制:延迟初始化错误是运用Hibernate开发项目时最常见的错误。如果对一个类或者集...原创 2009-03-10 11:01:03 · 55 阅读 · 0 评论 -
could not initialize proxy
could not initialize proxy - the owning Session was closed出现此错误的原因是当Session关闭的时候,在取与用户相关联的对象时候,就会出现此错误,例如:但Session没有关闭,获得对象User ,用户User与Role之间的关系是多对一,但Session关闭时,再通过User获得Role对象,就会出现下面的错误10-Mar-...2009-03-10 10:58:49 · 396 阅读 · 0 评论 -
hibernate 异常处理
异常:not-null property references a null or transient value用户与角色之间的关系是多对一,现在添加一用户,出现此异常的原因是1.表User中外键角色编号不为NULL,并且在User.hbm.xml 中 用户于角色之间的关系是多对一 而在Action中没有对角色编号赋值(为null)才...2009-03-05 16:14:45 · 82 阅读 · 0 评论 -
hibernate建表
Hibernate配置文件:<hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url"2009-08-06 21:19:08 · 108 阅读 · 0 评论