on 2020 Mar 10 2:11 PM
We added a localized string to Employee and ran into this problem:
It seems that at least in 1905 hybris uses servicelayer direct to persist the User items and the way that is implemented does not play well with maptypes.
In the core class DefaultAutitableSave.findBlacklistedAttributes it tries to add the items attribute values to a map by using streams.
As soon as more than one value is set in the maptype attribute this fails with a duplicate key error. (Java streams don't allow keys in map to be overwritten without specifying a merge function)
Am I missing something? I can't find any documentation about this.
Problem can be recreated like this:
<itemtype code="UserWithMapAttribute" extends="User" autocreate="true" generate="true">
<attributes>
<attribute qualifier="test" type="localized:java.lang.String">
<persistence type="property"/>
</attribute>
</attributes>
</itemtype>
URS, then create an item of type UserWithMapAttribute and save. Now try to set a value on the test attribute in two different languages and save.
Request clarification before answering.
User has the blacklisted field `encodedPassword` and the hybris code to handle blacklisted attributes is not capable of dealing with maptypes. Auditing can be turned off for the custom type by adding the type to the `auditing.blacklist` property. Thanks to Stefan Kruk!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.