title: Use of ENUMs in Grails Domain Class
body: <p>There are a few examples of ENUM on Grails (here in SO as well), but I am not being able to get the desired results. </p>
  
  <p>Solutions include
  1) By having the ENUM in a separate class under the src/groovy
  <em>Domain Class</em></p>
  
  <pre><code>class Offer {
      PaymentMethod acceptedPaymentMethod 
      ..
  }
  </code></pre>
  
  <p><em>src/groovy</em> PaymentMethod</p>
  
  <pre><code>public enum PaymentMethod {
      BYBANKTRANSFERINADVANCE('BANKADVANCE'),
      BYINVOICE('ByInvoice'),
       CASH('Cash'),
      CHECKINADVANCE('CheckInAdvance'),
      PAYPAL('PayPal'),
      String id
  
      PaymentMethod(String id) {
          this.id = id
      }
  }
  </code></pre>
  
  <p>In this case the Enum Class is not recognized at all at the domain class issuing an error. Looked like this used to work for Grails prior to version 2.</p>
  
  <p>Am I missing something here? How to use external ENUM class in a domain in Grails?</p>
  
  <p>2) Place ENUM within the domain class.</p>
  
  <p>In this case the grails does not complain while compiling, but the scaffolding does not include any info the ENUM values (it is like the property acceptedPaymentMethod is not included at all in the scaffolding process)
  Example: </p>
  
  <pre><code>class Offer {
      PaymentMethod acceptedPaymentMethod 
      ..
      enum PaymentMethod {
          BYBANKTRANSFERINADVANCE('BANKADVANCE'),
          BYINVOICE('ByInvoice'),
          CASH('Cash'),
          CHECKINADVANCE('CheckInAdvance'),
          PAYPAL('PayPal'),
          String id
  
          PaymentMethod(String id) {
              this.id = id
          }
      }
  }
  </code></pre>
  
  <p>Checking the structure of the DB Table, the field is not an ENUM but a simple VarChar: </p>
  
  <pre><code>| accepted_payment_method        | varchar(255) | YES  |     | NULL    |                |
  </code></pre>
  
  <p>Is there support for ENUMs on Grails Gorm at all?</p>