title: Behaviour of belongsTo
body: <p>What is the difference between </p>
  
  <blockquote>
    <p>static belongsTo [author:Author]</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>static belongsTo = Author</p>
  </blockquote>
  
  <p>Lets consider two domain class.</p>
  
  <pre><code>Class Author{
      String name 
  }
  
  Class Books{
      String name
      static belongsTo = Author
  }
  </code></pre>
  
  <p>When <strong>static belongsTo = Author</strong> is kept in Books domain, it have no effects on db. However, <strong>static belongsTo = [author : Author]</strong> creates a backreference to Author class and also there is author_id column in db. So, what actually using <strong>static belongsTo = Author</strong> alone does.
  This is expalined in grails docs(<a href="http://grails.github.io/grails-doc/latest/ref/Domain%20Classes/belongsTo.html" rel="nofollow">http://grails.github.io/grails-doc/latest/ref/Domain%20Classes/belongsTo.html</a>).</p>
  
  <p>Also, what is the difference between using following two : </p>
  
  <pre><code>Class Books{
      String name
      static belongsTo = [author : Author]
  } 
  Class Books{
      String name
      Author author
  }
  </code></pre>
  
  <p><strong>static belongsTo = [author : Author]</strong> is used only for cascading purposes, Is it true or does it have different use cases.</p>
  
  <p>Can anyone explain these in detail without relating it to hasOne or hasMany. Thanks in advance.</p>