Cannot marshall JaxbHbmBasicAttributeType to xml if the "generated" attribute is not specified

Description

bug description

Marshalling a JaxbHbmBasicAttributeType to xml throws a NPE if the generated attribut has not been set whereas the generated attribute of property-element is not declared as use="required" in the hibernate-mapping-4.0.xsd.

Step to reproduce

See attached test case

Workaround

explicitely set the generated attribute for JaxbHbmBasicAttributeType. It defaults to never, this value can be safely used.

Fix

handle a null argument in org.hibernate.boot.jaxb.hbm.internal.GenerationTimingConverter.toXml(GenerationTiming). See attached patch.

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Jean-Fran├žois Boeuf

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

backportDecision

None

Components

Affects versions

5.0.7
5.1.0

Priority

Trivial
Configure