This content has been marked as final.
Show 2 replies
-
1. Re: Straightforward ejb3 mapping problem
pmuir Jan 18, 2007 4:42 AM (in response to beligum)This question would be more suitable for the hibernate or ejb3 forums.
-
2. Re: Straightforward ejb3 mapping problem
beligum Jan 18, 2007 5:20 AM (in response to beligum)I've had a chat a few minutes ago and here's the answer:
(from http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#d0e161)Depending on whether you annotate fields or methods, the access type used by Hibernate will be field or property. The EJB3 spec requires that you declare annotations on the element type that will be accessed, i.e. the getter method if you use property access, the field if you use field access. Mixing EJB3 annotations in both fields and methods should be avoided. Hibernate will guess the access type from the position of @Id or @EmbeddedId.
I've put @Id on the variable instead of the getters, and that was the reason the field was called instead of the method.
For future reference...