This issue can't be edited

Because it belongs to an archived project. Jira admins can restore projects from the archive.

Embeddable object with an ElementCollection that contains Embeddable objects

Description

I have the following objects

I was expecting the Mongo object would look like this:

Instead it looks like this (which is not desired):

I can achieve the desired situation as follows:

However, this is not the way I want to store the objects.

Environment

Hibernate HQL: 1.2.0.Final Hibernate OGM: 5.0.0.Final Hibernate OGM MongoDB: 5.0.0.Final MongoDB Java Driver: 3.4.1

Attachments

2

Activity

Show:

Michael Wirth March 31, 2018 at 2:08 PM

I have the same issue. I really wonder why this issue hasn't come up earlier with more attention as having an ElementCollection in an Embeddable doesn't sound to be an exotic use case. Attention: this is not related having a nestedn ElementCollection in another ElementCollection.

Digging into the code I found the causing issue in the TypeHelper.class in Line 240. The recursive call has no effect at all, as it just copies the values into a new Object array, but doesn't process the result. A quick test showed that the issue can be fixed by applying the result values to the containing object:

Details

Assignee

Reporter

Labels

Bug Testcase Reminder (view)

Bug reports should generally be accompanied by a test case!

Bug Testcase Reminder (edit)

Bug reports should generally be accompanied by a test case!

Participants

MartijnP
Michael Wirth

Components

Affects versions

Priority

Created March 1, 2017 at 1:25 PM
Updated March 31, 2018 at 2:08 PM