title: Propper mapping of an ObjectId fields to String
body: <p>I'm doing a little bit of exploration out of my RDBMS world and into the mysterious seas of MongoDB. I'm using Spring Data to help me in my adventure. I need to create a manual reference between documents in two collections (I've read that DBRefs are expensive), my pojos are like this: </p>
  
  <pre><code>public class User {
      @Id
      private String id;
      private String name;
      private String password;
      ...
  }
  
  
  
  public class Game {
      @Id
      private String id;
      private String name;
      private String platform;
      private String userID;
      ...
  }
  </code></pre>
  
  <p>The userID is the id of an existing user, and it's stored as an ObjectId in the database. When I retrieve a Game document, the userID field is correctly mapped to a String value, but I want spring-data to do the inverse mapping when persisting (String to ObjectId), and I dont know how to do it.</p>
  
  <p>Can somebody point me in the right direction with this, please?
  Should I give up on this approach and go with the easy solution storing this field directly as a String?</p>
  
  <p>Thanks a lot!</p>