Skip to content

Identity enumType for Set of enums #14571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks
demon101 opened this issue May 7, 2018 · 0 comments
Open
4 tasks

Identity enumType for Set of enums #14571

demon101 opened this issue May 7, 2018 · 0 comments

Comments

@demon101
Copy link
Contributor

demon101 commented May 7, 2018

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

In grails 3.3 currently impossible to define enumType for a collection of enums. It works only for a separate field:
https://docs.grails.org/latest/ref/Database%20Mapping/column.html

@jameskleeh wrote: I don't think this is possible currently
https://stackoverflow.com/questions/50210992/grails-3-enumtype-for-set-of-enums?noredirect=1#comment87450991_50210992

With grails 3.2 following code works well, but with grails 3.3 it use enum names during saving to DB

class Test {
   Set<TestEnum> enums
   static mapping {
     enums  enumType: 'identity' // not works 
   }
}

enum TestEnum {
   final int id
   TestEnum(int value){
   ...
   }
}

  • Operating System: TODO
  • GORM Version: 6.1.9
  • Grails Version (if using Grails): 3.3.5
  • JDK Version: TODO

Example Application

  • TODO: link to github repository with example that reproduces the issue
@jdaugherty jdaugherty transferred this issue from apache/grails-data-mapping Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants