[jboss-user] [JBoss Seam] - Re: Straightforward ejb3 mapping problem

beligum do-not-reply at jboss.com
Thu Jan 18 05:20:36 EST 2007

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)

anonymous wrote : 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...

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4003211#4003211

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4003211

More information about the jboss-user mailing list