From the Hibernate docs:
"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 annotations in both fields and methods
should be avoided. Hibernate will guess the access type from the
position of @Id or @EmbeddedId."
Either is fine for day-to-day use (I have used both in the past).
However, when using Lombok you will always be using field access
because you are annotating the fields directly. Hibernate does not
require method annotations. I am not sure what is causing the
DuplicateMappingException, perhaps you have an issue with your
persistence.xml?
Regards,
Philip
> --
> You received this message because you are subscribed to the Google
> Groups group for http://projectlombok.org/
>
> To post to this group, send email to project...@googlegroups.com
> To unsubscribe from this group, send email to
> project-lombo...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/project-lombok?hl=en