![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Hibernate
Clearlove7·11
坚持一定有所得,永远不要让自己停止美好
展开
-
Hibernate异常之 org.hibernate.LazyInitializationException: failed to lazily initialize a collecio....
1、异常描述org.hibernate.LazyInitializationException:failed to lazily initialize a collection of role: cn.wang.entity.Clazz.studentSet,no session or session was closed备注: 此处hibernate版本号:3.6...原创 2019-08-02 15:23:46 · 507 阅读 · 2 评论 -
Hibernate异常之org.hibernate.HibernateException: /hibernate.cfg.xml not found
1、异常描述org.hibernate.HibernateException: /hibernate.cfg.xml not found备注: 此处hibernate版本号:3.6.10.Final2、分析原因一下是hibernate创建session工厂的示例代码: private static Configuration configure; pri...原创 2019-08-01 16:20:34 · 4525 阅读 · 0 评论 -
Hibernate异常之Exception in thread "main" org.hibernate.HibernateException: createQuery is not valid...
1、异常描述Exception in thread "main" org.hibernate.HibernateException: createQuery is not valid without active transaction备注: 此处hibernate版本号:3.6.10.Final2、示例代码以下是部分示例代码:public class Claz...原创 2019-08-01 16:30:06 · 431 阅读 · 0 评论 -
Hiberante异常之org.hibernate.LazyInitializationException: could not initialize proxy - no Session
1、异常描述org.hibernate.LazyInitializationException: could not initialize proxy - no Session备注: 此处hibernate版本号:3.6.10.Final2、示例代码:2-1 Clazz.hbm.xml<?xml version="1.0"?><!DOCTYP...原创 2019-08-01 16:52:55 · 171 阅读 · 0 评论 -
Hibernate异常之org.hibernate.ObjectNotFoundException: No row with the given identifier exists: .......
1、异常描述org.hibernate.ObjectNotFoundException:No row with the given identifier exists: [cn.wang.entity.Clazz#1005]备注: 此处hibernate版本号:3.6.10.Final2、示例代码2-1 Clazz.hbm.xml注意:此处已经关闭了Clazz的...原创 2019-08-01 17:13:27 · 268 阅读 · 0 评论 -
Hibernate异常之org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters
1、异常描述org.hibernate.QueryException: Expected positional parameter count: 1,actual parameters: [] [from Student where name like ?]备注: 此处hibernate版本号:3.6.10.Final2、示例代码2-1 StudentDao.jav...原创 2019-08-01 17:26:50 · 2353 阅读 · 0 评论 -
Hibernate异常之org.hibernate.QueryParameterException: Position beyond number of declared ordinal .....
1、异常描述org.hibernate.QueryParameterException:Position beyond number of declared ordinal parameters.Remember that ordinal parameters are 1-based! Position: 1备注: 此处hibernate版本号:3.6.10.Final...原创 2019-08-01 17:48:02 · 4606 阅读 · 2 评论 -
Hibernate异常之Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: cn...
1、异常描述Caused by: org.hibernate.MappingException:Repeated column in mapping for entity: cn.wang.entity.Student column:cid (should be mapped with insert="false" update="false")备注: 此处hibe...原创 2019-08-02 14:51:50 · 620 阅读 · 0 评论