title: Grails domain class constructor with id instead of object
body: <p>My domain class looks like this  :</p>
  
  <pre><code>class UserEvent { 
      User user
      Event event
      boolean isAttending
  }
  </code></pre>
  
  <p>Generated database table looks has following columns:</p>
  
  <pre><code>[ID , EVENT_ID, USER_ID , IS_ATTENDING ]
  </code></pre>
  
  <p>I have Event object and only id of User object (user_id).
  I want to create new UserEvent object with this data only, without loading User object, it may look something like this:</p>
  
  <pre><code>def userEvent = new UserEvent(user:['id':user_id],isAttending: true, event: event)
  </code></pre>
  
  <p>I've tried a lot of things but didn't find the solution. I think it is definitely possible, since it is done in a similar way with params in controllers which contain only ids of associated objects:</p>
  
  <pre><code> def userEvent= new UserEvent(params)
  </code></pre>
  
  <p>I am looking forward to finding the solution. Thank you.</p>