title: grails enum type in domain class
body: <p>I use grails 1.3.2 and hbase..</p>
  
  <p>I have domain class, one of which fields is in enum type:</p>
  
  <pre><code>class MyDomainClass{
  
       MyEnum enumVal
  
          //....
  
  }
  
  public enum MyEnum {
  
      val1("val1"),
      val2("val2")
  
     final String value
     MyEnum (String value) {
        this.value = value
      }
     String toString() { value }
     String getKey() { name() }
  }
  
  
  &lt;g:form action="create"&gt;
     &lt;g:select name="enumVal" from="${MyEnum ?.values()}" optionKey="key" /&gt;
     &lt;g:submitButton name="createOb" value="CreateOb"/&gt;
  &lt;/g:form&gt;
  </code></pre>
  
  <p>"create" action have to save selected value in db.</p>
  
  <p>When I submit I get exception:</p>
  
  <pre><code>Cannot cast object 'val1' with class 'java.lang.String' to class 'myPack.MyEnum '
  </code></pre>
  
  <p>Is there any way to save enum value as a String?</p>