We're updating the issue view to help you get more done. 

Shared type parameters results in inconsistent internal model (especially with DynamicParameterizedType)

Description

Looking at SimpleValueBinder.fillSimpleValue(), it is clear that the type parameters (a Properties instance) are shared between the type defs in the Mappings, the SimpleValue, and/or the SimpleValueBinder – no separate copies of these Properties instances are made anywhere, so changes to one reference are reflected in everybody's references (they're the same underlying Properties instance).

This makes it possible for multiple entity properties to share the same type parameters, so that customizations to the type parameters for one entity property are (incorrectly?) reflected in the type parameters for a different entity property, perhaps belonging to a different entity altogether.

This happened to us immediately when we tried to create a custom DynamicParameterizedType – see SimpleValue.getType(), which invokes createParameterImpl() only if the type parameters do not already have a PARAMETER_TYPE entry... but the type parameters may easily already have this parameter set, since the parameters are shared with other entity properties in the user model that may have already lazily initialized this entry.

This may be related to HHH-7936, but I can't tell from the bug description.

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Daniel Gredler

Components

Fix versions

Affects versions

4.2.6
4.3.8

Priority

Major