how to make property access the default for XJC generated code
Is there a way to make XJC generate code that uses property access
instead of field access by default?
The entities I am marshalling are lazily loaded with Hibernate and
CGLIB proxies. Using field access bypasses the proxy behavior.
After reading Kohsuke's blog article on field vs. property access,
I realize I can modify the generated files with
@XmlAccessorType(PROPERTY) or just move the @XmlElement annotations,
but many of the entities don't need other modifications, so it would
be convenient to control the default XJC behavior.
Any tips would be very much appreciated. I consulted all the JAXB 2.0
and XJC documentation I could find, but wasn't able to find any
answers on my own. Thanks.
P.S. After migrating from the JAXB 1.0 RI to the 2.0 RI, I have to
say, excellent work! The 2.0 RI is *much* nicer to work with.