Open GoogleCodeExporter opened 9 years ago
Sorry, let me explain the test case SubDomain storage :
Domain parent = domainService.store(appId, new Domain("test1", null));
Domain subdomain = domainService.store(appId, new Domain("test2", null));
SubDomain subDomain = new SubDomain("name", parent, subdomain, null);
subDomain.setId(new PK(appId, new ObjectId().toString()));
MongoDBHelper.getDatastore().save(subDomain);
Note that if I set the referenced fields (parent ane subdomain) to null, the
test passes.
Original comment by obalb...@gmail.com
on 28 Mar 2012 at 9:51
The problem looks to be the last line in DefaultMapper.keyToRef:
return new DBRef(null, key.getKind(), key.getId());
The key id should be serialized before being placed in the DBRef
Test case demonstrating the problem here:
https://github.com/jmkgreen/morphia/pull/10
Original comment by benjamin...@gmail.com
on 4 Nov 2012 at 7:05
Original issue reported on code.google.com by
obalb...@gmail.com
on 28 Mar 2012 at 8:59