ElementCollection referencing other primivive attribute breaks column nullability meta

Description

The subsequent entity has to attributes "parent" and "children":

  • both are of primitive type.

  • "children" is an element collection referencing "parent"

  • "parent" is nullable

However, the subsequent example below does not work anymore in Hibernate 5.0.4 and 5.1.0. It used to work fine in 4.3. For some reason, it expects parent to be not-nullable. Checking the metadata (org.hibernate.mapping.Property) shows that value is of Type SimpleValue and in there is a column "parent" that is not nullable anymore. At some point a nullable "parent" column is created, but it seems to get overriden by the element table of "children".

Environment

None

Status

Assignee

Unassigned

Reporter

Remo Meier

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure