DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Thomas Kratz
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store MongoDB

ManyToOne in an Embeddable gets embedded

Created: 22/Jul/12 03:28 PM   Updated: 09/Aug/12 03:33 PM   Resolved: 06/Aug/12 03:37 PM
Component/s: Persistence
Affects Version/s: 3.0.6
Fix Version/s: None

Environment: equinox, jpa mapping

Datastore: MongoDB
Severity: Development

 Description  « Hide
Hi, I truly don't know if this is meant to be so by the jpa api. Today I found that a @ManyToOne relation from an @ElementCollection embedded @Embeddable to another @Entity gets stored embedded in the document. maybe this is just not what I want. If this is not a bug, is there a way to not store it embedded but as a link?

Any hint will be appreciated.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 22/Jul/12 04:10 PM
Obviously any issue has to have a testcase, that would demonstrate something with recent code (i.e 3.1); additionally JIRA is not for posing questions ... that is what the forum is for.

Thomas Kratz added a comment - 22/Jul/12 05:31 PM
Just created

which shows my issue

Thomas Kratz added a comment - 23/Jul/12 10:57 AM
Hi Andy, sorry for not being sure about this.
According to the JPA Spec in Chapter 2.6 @ManyToOne is legal in an ElementCollection of Embeddables. I hope my testcase is clear enought to show, that the relation gets persisted as if it was another Embedded Object. You will have to look at the actual structure the you find in the db after running the test.

Let me know if I con provide any help.

Thomas Kratz added a comment - 26/Jul/12 07:48 PM
Hi again,
not commenting on this makes me feel very insecure. I wonder if this is a mongo related issue or if its a problem in core. Plus I wonder if you will help me get this fixed in time, as it's crucial to my decision of building my platform on it. I am ready to contribute to this issue if needed, but at least I will need some assistance.

Andy Jefferson added a comment - 06/Aug/12 02:55 PM
I simply don't have time to look at external testcases in some other format than the DN docs ... except for people with support contracts. The code is available in SVN trunk (v3.1) and you only refer to 3.0.6 which I'm obviously not touching either.

Thomas Kratz added a comment - 06/Aug/12 03:05 PM
Hi Andy, sorry for saying that, but I'm a not for profit free time programmer in this case. The words you have chosen and even the time you needed to answer that you obviously don't care make it an easy decision that I will not use your software. Thanks for clearing that up.

Andy Jefferson added a comment - 06/Aug/12 03:37 PM
"Don't care"? The hours I spend writing this software and requesting users to do something as simple as use latest versions, and possibly just look at the code if they need something urgently, then when I don't jump to their tune I get "ok I won't use your software". Fine by me, since you pay me nothing and gave nothing to the project for that free software. All of our test cases pass, so our functionality is guaranteed. Good luck.