Repository navigation
MongoDB enum id number support - #35
sagrawal31 wants to merge 8 commits into
Conversation
storing in Basic.java holder.
There was a problem hiding this comment.
I don't really understand why this is in the geo package as it seems to have nothing to do with geospatial. Please move to a more appropriate package. Also please add apache license.
There was a problem hiding this comment.
Oops, I added the class in this package by mistake. I'll fix this.
|
@graemerocher Done review changes as asked. |
|
@graemerocher I made this branch from the tag 3.1.0 (which is currently shipped with grails mongodb plugin). |
|
One more thing, could you submit to the 3.x branch? The master branch probably won't make it into a 2.x release of Grails |
|
@graemerocher Yeah Sure. I need to do a rebase of 3.x on my branch before creating a pull request. I'll post you after doing rebase & new pull request. |
|
@graemerocher Created another pull request #41 to branch 3.x as you asked. This pull request can be closed now. |
|
closing this one as applied to 3.x branch. Thanks. |
Implementation Notes
Problem
Please see http://stackoverflow.com/questions/23888644/saving-enum-with-custom-id-in-grails-mongodb for detailed description of the requirement.
Solution
Previously, enums are treated as simple type causecode/grails-data-mapping@grails:master...mongo-enum-number#diff-ce0fefe1d4dc415ed55802d866b73408L131, but now first checking if enum has a user type then marking it as custom type.
Added enum type marshaller to support enum number conversion (in read, write & query operations) and also support enums with no id (default behavior).