HIbernate Mapping Exception: PropertyNotFoundException: Could not find a setter

前端 未结 2 1160
误落风尘
误落风尘 2021-01-04 23:56

I have two POJO\'s ,STOCK and STOCK_DETAILS (one to many relationship). Also I have one interface IAUDITLOG (having two methods). I need to implement this interface with BOT

相关标签:
2条回答
  • 2021-01-05 00:43

    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

    0 讨论(0)
  • 2021-01-05 00:53

    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.

    0 讨论(0)
提交回复
热议问题