title: Find max value in table column
body: <p>I am creating a version control domain class in Grails:</p>
  
  <pre><code>class VersionControl {
  
      Date dateCreated
      Long versionNumber
  
      Long getLatestVersionNumber() {
          //return largest versionNumber
      }
  
  }
  </code></pre>
  
  <p>I would like to add a query to get the largest version number stored:</p>
  
  <pre><code>Long getLatestVersionNumber()
  </code></pre>
  
  <p>In SQL this query would look more or less as follows:</p>
  
  <pre><code>SELECT TOP 1 MAX(versionNumber) FROM VersionControl
  </code></pre>
  
  <p>The function MUST return the value as a long.</p>
  
  <p>What is the correct way to do this in Grails?</p>