Issue Details (XML | Word | Printable)

Key: NUCMONGODB-134
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Robin Zhang
Votes: 0
Watchers: 1
Operations

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 MongoDBStoreManager.java.patch (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)

Robin Zhang added a comment - 01/Dec/13 02:34 PM
I made a patch, it looks well.

Robin Zhang made changes - 01/Dec/13 02:34 PM
Field Original Value New Value
Attachment MongoDBStoreManager.java.patch [ 12037 ]
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 made changes - 02/Mar/14 07:17 PM
Priority Major [ 3 ] No Testcase [ 6 ]
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

Andy Jefferson made changes - 13/Apr/14 10:46 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
Andy Jefferson made changes - 25/Apr/14 02:46 PM
Status Resolved [ 5 ] Closed [ 6 ]