Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

MongoDB enum id number support - #35

Closed
sagrawal31 wants to merge 8 commits into
apache:masterfrom
causecode:mongo-enum-number
Closed

sagrawal31 wants to merge 8 commits into
apache:masterfrom
causecode:mongo-enum-number

Conversation

@sagrawal31

Copy link
Copy Markdown

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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I added the class in this package by mistake. I'll fix this.

@sagrawal31

Copy link
Copy Markdown
Author

@graemerocher Done review changes as asked.

@sagrawal31

Copy link
Copy Markdown
Author

@graemerocher I made this branch from the tag 3.1.0 (which is currently shipped with grails mongodb plugin).

@graemerocher

Copy link
Copy Markdown
Contributor

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

@sagrawal31

Copy link
Copy Markdown
Author

@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.

@sagrawal31

Copy link
Copy Markdown
Author

@graemerocher Created another pull request #41 to branch 3.x as you asked. This pull request can be closed now.

@graemerocher

Copy link
Copy Markdown
Contributor

closing this one as applied to 3.x branch. Thanks.

@sagrawal31
sagrawal31 deleted the mongo-enum-number branch October 8, 2015 12:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants