HIbernate Mapping Exception: PropertyNotFoundException: Could not find a setter

大兔子大兔子 提交于 2019-11-30 19:26:35

You should annotate the overridden methods with @Transient.

http://docs.oracle.com/javaee/5/api/javax/persistence/Transient.html

This annotation specifies that the property or field is not persistent. It is used to annotate a property or field of an entity class, mapped superclass, or embeddable class.

P.s. As of Hibernate 3 collections are lazy by default so there is no need to explicitly mark it as lazy.

For others who come across this and the above solution does not work, my error was that the name for my setter was not correct; it did not match the property it was setting. That's all

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!