Excluding fields in JAXB
You can use @XmlTransient
on the field. Also the default JAXB bindings can be overridden at a global scope or on a case-by-case basis as needed by using custom binding declarations.
Check out the Guide to JAXB from Baeldung website for more examples.
You can use annotation @XmlTransient
to ignore fields. Put this annotation on field itself or its getter.