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: Robin Zhang
Votes: 0
Watchers: 1

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

NullPointerException catched when super entity has no primary key(with @MappedSuperclass annotation)

Created: 01/Dec/13 02:33 PM   Updated: 25/Apr/14 02:46 PM   Resolved: 13/Apr/14 10:46 AM
Component/s: Schema
Affects Version/s: 3.2.4
Fix Version/s: None

File Attachments: 1. Text File (0.8 kB)

Environment: JDK 6, MongoDB v2.4

Datastore: MongoDB

 Description  « Hide
I have many entity class extents a base entity which annotated with "MappedSuperclass", this base entity have no primary key definition. I defined primary key in every entity class.

but when I launched the program, I got the NullPointerException in MongoDBStoreManager,java(cmd.getPKMemberPositions() returned null)

Sort Order: Ascending order - Click to sort in descending order
Robin Zhang added a comment - 01/Dec/13 02:34 PM
I made a patch, it looks well.

Andy Jefferson added a comment - 01/Dec/13 06:59 PM
Just ignoring PK fields is not the answer. All objects to be persisted will have a PK and the PK fields need setting. You cannot *persist* a MappedSuperclass with no PK fields. So please take a step back and define a test for this situation, that demonstrates the NPE

Andy Jefferson added a comment - 02/Mar/14 07:17 PM
Downgrading to no testcase since not responded to the previous comment, and no testcase provided that demonstrates something

Andy Jefferson added a comment - 13/Apr/14 10:46 AM
No testcase 4 months after the initial report. No way of seeing anything. Post back here with your testcase and it could be reopoened