The default configuration of hyperjaxb
is creating hibernate annotations that result in hibernate
annotations that produce incredibly verbose SQL
statements that result in SQLException
s at worst and slow performance at best. Specifically, the CascadeType.ALL
setting seems to be the default. How do I override the default settings so that CascadeType
, FetchType
, and other parameters are set on a customized basis? And is it possible to set these default variables on a global level so that I do not have to change every one of many hundreds of references in my schema.xsd file?
Here is an example. Hyperjaxb
is generating the following hibernate
annotation:
@ManyToOne(targetEntity = Code.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "SOME_CODE1_P_0")
public Code getSomeCode1() {
return someCode1;
}
from the following schema fragment:
<xs:complexType name="SomeTypeName">
<xs:sequence>
<xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="someCode1" type="Code" minOccurs="0"/>
<xs:element name="someCode2" type="Code" minOccurs="0"/>
<xs:element name="someCode3" type="Code" minOccurs="0"/>
<xs:element name="someCode4" type="Code" minOccurs="0"/>
<xs:element name="someCode5" type="Code" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Code">
<!--<xs:sequence>elements with nested data types omitted for simplicity</xs:sequence>-->
<xs:attribute name="code" type="xs:string" use="optional"></xs:attribute>
<xs:attribute name="Name" type="xs:string" use="optional"></xs:attribute>
</xs:complexType>