标题:hibernate 一对多关联问题?
只看楼主
ynw520
Rank: 1
等 级:新手上路
帖 子:100
专家分:0
注 册:2006-8-24
 问题点数:0 回复次数:5 
hibernate 一对多关联问题?
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.PropertyNotFoundException: Could not find a getter for forum in class com.ynw.Subforum
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.mapping.Property.getGetter(Property.java:260)
at org.hibernate.tuple.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:255)
at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:121)
at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at com.ynw.ForumOperate.<init>(ForumOperate.java:19)
at com.ynw.Test.main(Test.java:7)


搜索更多相关主题的帖子: hibernate org java property getter 
2007-09-17 09:24
ningkun
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2007-9-15
得分:0 
没有这个属性吧,要是有的话就是延迟加载的问题,建议把lazy改成false试一下。

共同学习,共同进步,呵呵!
2007-09-17 17:57
q4279134
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-8-19
得分:0 
一看就是PO里面少了属性的get()方法啊
2007-09-18 20:21
atsjun
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2007-9-8
得分:0 
同上
forum 这个属性 没有get方法

2007-09-21 20:55
lgdcky
Rank: 2
等 级:论坛游民
威 望:5
帖 子:576
专家分:18
注 册:2006-8-5
得分:0 
forum缺少get()!

2007-09-21 21:30
roemin
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2010-1-24
得分:0 
Could not find a getter for forum in class com.ynw.Subforum
2010-01-24 19:48



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-170491-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.266399 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved