title: embedded grails sql views
body: <p>I have a question about using sql views and "embedded" fields in domain classes. I created a sql view (which contains, among other things, name, shipping_name, billing_name columns) that I associated with a modeled domain class as below. Both classes are in the same file. I tried to move WebOrdressAddress in it's own file (in src/main/groovy) but it does not work.</p>
  
  <pre><code>class WebOrderView {
  
      String name
  
      WebOrderAddress shipping
  
      WebOrderAddress billing
  
      static embedded = ["shipping", "billing"]
  
      static mapping = {
          table 'web_order_vw'
          version false
      }
  }
  
  class WebOrderAddress {
      String name
  }
  </code></pre>
  
  <p>When I use a finder (like WebOrderView.findByName('test')) I get "null". If I comment the lines "embedded", "shipping", "billing" and I use the same finder I get a result. Can you tell me what's wrong with embedded fields ? Do embedded fields work with sql views? I'm using Grails 3.2.11</p>
  
  <p>Thanks</p>