<composite-map-key> sub-properties are assumed to be non-updatable using HBM mappings

Description

Currently, <composite-map-key> sub-properties are mapped as non-updatable when using HBM mappings because CompositeIdentifierSingularAttributeSourceBasicImpl#isUpdatable returns false.

This does not seem to break anything currently because AbstractCollectionPersister only tracks whether an index is "settable":

indexColumnIsSettable[i] = indexColumnInsertability[i] || indexColumnUpdatability[i];

Annotations supports:

@MapKeyColumn(name = "...", insertable = true, updatable = false)

Currently, such a mapping will result in the map key column being updated (although it shouldn't be). That fix will be covered by another issue.

Once it is fixed, colums in a <composite-map-key> will no longer get nullified when removing a row from a @OneToMany collection. BackrefCompositeMapKeyTest is an example where this can happen (although it probably won't cause a test failure).

Environment

None

Assignee

Unassigned

Reporter

Gail Badner

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

Major
Configure