title: How do you persist a collection of Enums in Grails?
body: <p>Any ideas on how to persist a collection of enums in Grails?</p>
  
  <p>Groovy enum:</p>
  
  <pre><code>public enum MyEnum {
    AAA('Aaa'),
    BEE('Bee'),
    CEE('Cee')
    String description
    MyEnum(String description) {
      this.description = description
    }
    static belongsTo = [tester:Tester]
  }
  </code></pre>
  
  <p>I want to use this enum in a Grails domain class.  The domain class looks like this: </p>
  
  <pre><code>class Tester {
    static hasMany = [myenums: MyEnum]
    static constraints = {
    }
  }
  </code></pre>
  
  <p>In my create.jsp, I want to be able to select multiple MyEnums and have the following line:</p>
  
  <pre><code>&lt;g:select  from="${MyEnum?.values()}" multiple="multiple" value="${testerInstance?.myenums}" name="myenums" &gt;&lt;/g:select&gt;`
  </code></pre>
  
  <p>The problem I'm getting is when I try to create a new Tester, I get a 500 error saying:</p>
  
  <pre><code>Exception Message: java.lang.String cannot be cast to java.lang.Enum
  Caused by: java.lang.String cannot be cast to java.lang.Enum
  Class: TesterController 
  </code></pre>