We have this XML:
<Summary>
<ValueA>xxx</ValueA>
<ValueB/>
</Summary>
<ValueB/>will never have any attributes or internal elements. This is an element of type boolean - it exists (true) or does not matter (false).
JAXB generated a Summary class with a String valueA element, which is good. But for ValueB, JAXB created an inner ValueB class and the corresponding member:
@XmlElement(name = "ValueB")
protected Summary.ValueB valueB;
But I need a member booleanand not an inner class:
@XmlElement(name = "ValueB")
protected boolean valueB;
How can you do this?
I do not want to restore classes, I would just like to change the code manually.
Update . In accordance with the accepted answer, we created a new method that returns a logical value, depending on the value valueB == null.
Hibernate, B @Transient Hibernate @Column.