当前位置: 代码迷 >> Java Web开发 >> hibernate 一对多关联问题?
  详细解决方案

hibernate 一对多关联问题?

热度:375   发布时间:2007-09-17 09:24:23.0
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  

----------------解决方案--------------------------------------------------------
没有这个属性吧,要是有的话就是延迟加载的问题,建议把lazy改成false试一下。

----------------解决方案--------------------------------------------------------
一看就是PO里面少了属性的get()方法啊
----------------解决方案--------------------------------------------------------
同上
forum 这个属性 没有get方法

----------------解决方案--------------------------------------------------------
forum缺少get()!
----------------解决方案--------------------------------------------------------
Could not find a getter for forum in class com.ynw.Subforum

----------------解决方案--------------------------------------------------------
  相关解决方案