title: Special Datatypes used in Domain Classes
body: <p>Imagine for example you want to store amounts of money in a domain class. A simple approach would be something like this:</p>
  
  <pre><code>class Account {
      BigDecimal amount
  }
  </code></pre>
  
  <p>but what if you don't want to handle your amount as simple <code>BigDecimal</code> but as <code>Money</code> type on which you have for instance defined some additional convenience methods like currency conversions.</p>
  
  <p>So something like</p>
  
  <pre><code>class Account {
      Money amount
  }
  </code></pre>
  
  <p>would result in getting it stored in another table.</p>
  
  <p>So my question is: how can I define a class <code>Money</code> which would be stored as BigDecimal in the database? </p>