Field-local generics information not honored [DATACMNS-697] #1164
Comments
Max Alexejev commented Executable tests |
Oliver Drotbohm commented Thanks for finding this, Max! I've altered |
Max Alexejev commented Great job, Oliver! Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Max Alexejev opened DATACMNS-697 and commented
In my project, we have an entity called
NormalizedProfile
, which is a huge collection of genericListField
s. Each listField is a list ofValue
s plus some metadata. AndValue
is a (well) single "value" plus some metadata. In our case, atomic "value" is either primitive wrapper, Object or Enum, never a collection (in case it is relevant).Value<T>
gets its generic type fromListField<T>
it is enclosed in. Nothing fancy.In addition to standard java SpringDataMongo config, we customise
MappingMongoConverter
to stop save and use "_class" field. No polymorphic behaviour is needed in our case, so why not.Problem is with Object- and Enum- generalized
ListField
s. After they are saved, they never read as a real object and returned as LHM instead. When I usejava.util.List
instead of our custom structure, everything works fine.Please see attached minimal test -
j.u.List<Education>
testcase succeeds andListField<Education>
failsAffects: 1.10 GA (Fowler)
Attachments:
Backported to: 1.10.1 (Fowler SR1), 1.9.3 (Evans SR3), 1.8.6 (Dijkstra SR6)
The text was updated successfully, but these errors were encountered: