1

I'm using the default cascade options Hyperjaxb assigns. However, there is an exceptional case where I need to override. Suppose I have a type defined as follows:

<xsd:complexType name="DogType">
<xsd:sequence>
    <xsd:element ref="cac:DogOwner" minOccurs="0"/>
    <xsd:element ref="cac:FavoriteFood" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>

Now, obviously when I remove a Dog, its owner should not be deleted. However, the default cascade option for DogOwner is ALL. How can I override the CascadeType for DogOwner so it cascades in all cases except REMOVE?

Thank you.

deterjan
  • 348
  • 3
  • 16
  • 1
    I can't give the full answer at the moment, but check [this example project](https://github.com/highsource/hyperjaxb3/blob/master/ejb/tests/cu-one/src/main/resources/schema.xsd), it gives a pretty good idea of how you can customize generated mappings. – lexicore Jul 28 '17 at 06:33

0 Answers0