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

MongoDB enum identity number support - #41

Merged
graemerocher merged 9 commits into
apache:3.xfrom
causecode:mongo-enum-id
Sep 12, 2014
Merged

graemerocher merged 9 commits into
apache:3.xfrom
causecode:mongo-enum-id

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 https://github.com/grails/grails-data-mapping/blob/3.x/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/model/MappingFactory.java#L131, 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 ordinal mapping and enum with no id (default behavior).

Reverted the commit 6ee2e12 and added support in new EnumType. This enhanced & fixed querying a domain class with an enum which is mapped as ordinal.

@sagrawal31 sagrawal31 changed the title Mongo enum MongoDB enum identity number support Aug 29, 2014
@sagrawal31

Copy link
Copy Markdown
Author

Reference #35

graemerocher added a commit that referenced this pull request Sep 12, 2014
MongoDB enum identity number support
@graemerocher
graemerocher merged commit 1d2c066 into apache:3.x Sep 12, 2014
@sagrawal31

Copy link
Copy Markdown
Author

Thank You @graemerocher for replying.

@sagrawal31

Copy link
Copy Markdown
Author

@graemerocher How can I use the changes added in this pull request for grails version 2.4.4 and mongodb 3.0.2.

I'm unable to use that.

@sagrawal31

Copy link
Copy Markdown
Author

Actually its not available in jar of 3.0.2.RELEASE. Can you please do another release to make it available?

@graemerocher

Copy link
Copy Markdown
Contributor

We have not yet released a new version of mongodb, we can certainly do that shortly

@sagrawal31

Copy link
Copy Markdown
Author

Thank You @graemerocher for reply. We are waiting on new release.

@sagrawal31
sagrawal31 deleted the mongo-enum-id branch October 8, 2015 12:48
jdaugherty pushed a commit to jdaugherty/grails-data-mapping that referenced this pull request Jan 16, 2025
It is happening because of `GrailsWebUnitTest.super.applyTemplate`. Either we need to add check if GrailsWebUnitTest is resolved or we could simply call super.applyTemplate from parent traits.
jdaugherty pushed a commit to jdaugherty/grails-data-mapping that referenced this pull request Jan 16, 2025
apache#41 Fixed BUG! exception in phase 'semantic analysis'
jamesfredley pushed a commit that referenced this pull request Mar 8, 2025
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