title: Lazy Loading In GORM Grails
body: <p>I am trying to get lazy loading in <code>Java Clas</code>s of relationship in <code>groovy domain class</code>, when i use <code>lazy: false</code> it works but when i mark <code>lazy:true</code> then it did not get table data.
  I am using below code :- </p>
  
  <p><strong>Domain Class :-</strong> </p>
  
  <p>Product Domain Class :- </p>
  
  <pre><code>class Products {
  
      static mapping = {
          version  false
          id name: 'productId', generator:'assigned'
          }
  
      String productId
      String reference 
      String code  
      String codetype 
  }
  </code></pre>
  
  <p>Stock Domain Class :- </p>
  
  <pre><code>class Stock {
  
      static mapping = {
          version  false
          id name: 'stockId', generator:'assigned'
          product column:"product",lazy:true
          }
  
      String stockId
  
      Products product
  
  
      static belongsTo = [product: Products] 
  }
  </code></pre>
  
  <p><strong>Services Class :-</strong> </p>
  
  <pre><code>@Transactional
  class StockService {
      public List&lt;Stock&gt; getStockList() {
  
  
              def stock = Stock.list()
               return stock
  
          }
  }
  </code></pre>
  
  <p><strong>Java Class to get Stock data and Product Data :-</strong></p>
  
  <pre><code>   StockService stockService = Grails.get(StocktService.class);
     List&lt;Stock&gt; stock = stockService.getStockList();
     Products product = stock.get(0).getProduct();
  </code></pre>
  
  <p>But the product object is showing <code>null</code>. it should should product data. is there anything wrong with above code?</p>