title: Grails belongsTo either class
body: <p>I have an Abstract, non-domain class Job:</p>
  
  <pre><code>abstract class Job {
      String jobId
      String jobName
      String jobNotes
  }
  </code></pre>
  
  <p>Then I have these two domain classes Task and Habit, both of which inherit the Job class:</p>
  
  <pre><code>class Task extends Job{
      Date deadline
      int completionTime
  }
  
  class Habit extends Job{
      Date rangeStart
      Date rangeEnd
  }
  </code></pre>
  
  <p>Now both tasks and habits own one or more Subtasks. Now my problem is that I want the SubTasks to belong to either Task or Habit, which are both subclasses of Job. I tried doing this, but didn't work:</p>
  
  <pre><code>class SubTask {
      static belongsTo = {motherJob : Job}
  }
  </code></pre>
  
  <p>Can you help me?</p>