Parameter binding mismatch on insert when an @ElementCollection @MapKeyColumn uses a declared field of an @Embeddable value

Description

Considering the following mapping involving an @Entity with an @ElementCollection of type Map with @Embeddable as value and a declared column of this @Embeddable as Key:

When adding a new "State" class to the Map then Flushing, the number of parameters in the SQL insert
statement does not matches the number of bind parameters. There is one extra
parameter set to null value, which makes the underlaying driver to trigger an
exception (see log below). This has been tested with MariaDB and H2.

Here the test code:

and the output exception :

Environment

Linux, openjdk version "11.0.4" 2019-07-16, Ubuntu 4.15.0-55-generic, MariaB / H2

Status

Assignee

Unassigned

Reporter

Benjamin Legendre

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Feedback Requested

2019/08/05

Feedback Requested By

Gail Badner

Components

Affects versions

Priority

Major
Configure