title: Override getter in grails domain class for relation version issues
body: <p>I have an existing application with the following domain classes/relations:</p>
  
  <pre><code>class Contact {
   static hasMany = [phones: Phone]
  }
  </code></pre>
  
  <p>I would like to modify the structure to allow for a delete flag to be set in the Phone class and then not have to modify existing calls to the getter for phones to get phones that have not had that delete flag set.</p>
  
  <p>ex:</p>
  
  <pre><code>contact.phones
  </code></pre>
  
  <p>I have seen a post on this site detailing how to do this.
  <a href="https://stackoverflow.com/questions/17169657/override-getter-and-setter-in-grails-domain-class-for-relation">StackOverflowPost</a></p>
  
  <p>I have tried that approach(modifications showed below) but GORM is behaving oddly by incrementing the version when it shouldn't be.  I'll hit the contact edit page and then when a version comparison is done on the server after submitting the form the version in the DB has incremented up about 5 or 6 times compared to the version value that was passed to the edit.gsp.  I have also applied this pattern to two more relations so I'm thinking they are also causing the version to increment.  I'm going to test with only one domain relation modification to see if I can find a pattern.  Does anyone have any ideas as to the right way to do this or how to avoid version incrementing?</p>
  
  <pre><code>class Contact {
  
   Set&lt;Phone&gt; phones
  
   static hasMany = [phones: Phone]
  
   Set&lt;Phone&gt; getPhones() {
      phones.findAll { !it.deleted }
   }
  
  }
  </code></pre>