Closed GoogleCodeExporter closed 9 years ago
An ObjectId != String.
You should declare your class with @Id ObjectId id
Original comment by scotthernandez
on 28 Nov 2011 at 1:41
This is pure nonsence, why not abstract the ids then into a super class such as
MorphiaEntity and all of them inherit the id from it?
Original comment by fady.ma...@gmail.com
on 28 Nov 2011 at 2:40
You can do whatever you like.
Not everyone uses the same type for @Id in every entity. You are making a lot
of assumptions about use patterns here.
The @Id field is just a unique (and immutable) field which used by the system
(mongodb). It really only is special because there is an index created for it
by default and if you don't provide a value then an ObjectId will be assigned
to it.
Original comment by scotthernandez
on 28 Nov 2011 at 2:46
The issue is not the id, the issue is with the broken API. Even with that
approach:
datastore.delete(entity) // won't work,
datastore.merge(entity) // won't work either
What's the usecase of those classes?
Original comment by fady.ma...@gmail.com
on 28 Nov 2011 at 2:54
The issue is not the id, the issue is with the broken API. Even with that
approach:
datastore.delete(entity) // won't work,
datastore.merge(entity) // won't work either
What's the usecase of those classes?
Original comment by fady.ma...@gmail.com
on 28 Nov 2011 at 2:54
Original issue reported on code.google.com by
fady.ma...@gmail.com
on 28 Nov 2011 at 12:42