Hyperjaxb/lombok : how to force Hyperjaxb generate annotations mapping on attributes and not on the methods?

StackOverflow https://stackoverflow.com/questions/16147032

문제

I would like jpa annotations on my attributes, not on getter and setter. It is possible to configure hyperjaxb for this ?

I want this because I use lombok in order to avoid getter and setter code and have "@getter" "@setter" above attributes.

thank you

도움이 되었습니까?

해결책

This is not supported out of the box at the moment (please file an issue if you need this functionality).

However you can do it by writing and overriding your own implementation of org.jvnet.hyperjaxb3.ejb.strategy.annotate.AnnotateOutline. See https://svn.java.net/svn/hj3~svn/trunk/ejb/tests/custom-naming/ for an example of overriding a strategy.

But be aware that Hyperjaxb has to use getters/setters to workaround some of the JAXB/JPA incompatibilities (for example simple type which is not supported by JPA). If you put annotations on fields, this won't work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top