![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Hibernate
文章平均质量分 77
superperson976
这个作者很懒,什么都没留下…
展开
-
net.sf.hibernate.QueryException: unexpected token:
net.sf.hibernate.QueryException: unexpected token: as [select * from commanycredit as c where c.commanyid=71][color=red]抛出异常的原因[/color]:由于c.commanyid = 71 可以查到多条记录引起的!...2008-05-31 10:43:34 · 162 阅读 · 0 评论 -
QueryException: unexpected token:
QueryException: unexpected token: as [from users as u where u.userID='1006'][color=red]引起原因:[/color]users 应该是pojo对象,而我写成了数据库表名。望初学者引起注意。...2008-05-31 10:48:37 · 207 阅读 · 0 评论 -
Exception:StackOverFlowError
list =(List) hibernateSysManagerService.findByTId(Integer.parseInt(userid)); if(list!=null){ tuser = (Tuser)list.get(0); }System.out.println("测试"+tuser);便抛出异常!处理结果:System.out.printl...2008-05-31 11:02:27 · 86 阅读 · 0 评论 -
Hibernate.initialize(Object obj)
关于延迟加载(lazy)和[color=red]强制加载(Hibernate.initialize(Object proxy) ) [/color]等 在使用hibernate进行持久化时,有时需要动态的改变对象的加载,比如在编辑页面里面lazy=true,而在浏览页面lazy=false,这样可以在需要lazy的地方才进行控制。而配置文件中Lazy属性是全局控制的,如何处理呢? ...原创 2009-05-06 20:49:08 · 61 阅读 · 0 评论 -
hibernate.sourceforge.net Nested exception: hibern
在Configuration.buildSessionFactory中,parse xxx.hbm.xml的时候,经常抛出UnknowHostException:hibernate.sourceforge.net,而我将DTD换成我本地的地址就可以了,难道一定要写上DTD引用的吗?如果我的server没连在internet上面,要把DTD放在本地,但我如果换了路径,那岂不是要将所有的XML都修改...原创 2009-06-04 14:44:30 · 409 阅读 · 0 评论 -
牛人论Hibernate-+spring+struts ,Hibernate.initialize(
--------牛人论Hibernate-spring-struts-----------[color=darkred]http://www.iteye.com/topic/15057[/color]------------------今天在了解Hibernate.initialize(object)时无意中在网上一个论坛里看到这样的帖子,这是2005年的旧帖(已经被评为精华贴)看...原创 2009-06-04 23:52:47 · 83 阅读 · 0 评论 -
Hibernate Object[]
(1)String sql = "select status from LessionNew" 对于只取一个字段的封装,只能用Object obj = (Object)list.get(o);int = (Integer)obj;(2)对于两个或者两个以上的字段如:"select id, name,status from LessionNew"用Object []...2008-12-15 19:01:29 · 248 阅读 · 0 评论 -
jsp 数据库插入乱码问题
若直接写的sql语句只须将前面加一个:N 即可解决插入sql 数据库中文乱码问题insert into class(class_name,status) values(N'+userName+',N'0')-------------------------------------------------------------------下面是一般的解决方法:***.do 传出...2008-12-22 18:10:33 · 96 阅读 · 0 评论 -
No row with the given identifier exists: 2602, of class: bss.model
No row with the given identifier exists: 2602, of class: bss.model.bank 在执行的时候报这样的错误,经过查找发现bank这一张表里面,没有数据导致在根据bank_id 获取实例的时报错啦 希望再遇到的朋友,作为参考........................原创 2010-11-11 19:32:09 · 59 阅读 · 0 评论