title: Save Entity (which contains another Entity) from JSON
body: <p><b>Background:</b></p>
  
  <p>I'm making pages with JSON-based CRUD functionality. These pages feature select lists populated with my entities via Knockout.js. I have one entity <code>Contract</code> that has a currently nullable many-to-one relationship <code>contractHolder</code> with another of my entities, <code>Organization</code>. </p>
  
  <p>I can successfully create a <code>Contract</code> via JSON through my Roo-generated controller, as long as <code>contractHolder</code> is null. </p>
  
  <p>My attempts to create a <code>Contract</code> with a non-null relationship end in errors, regardless of whether I provide an integer ID (java.lang.Integer cannot be cast to java.util.Map) or a full JSON object (org.hibernate.TransientObjectException: object references an unsaved transient instance). </p>
  
  <p>All told, I am trying to save a <code>Contract</code> with an <code>contractHolder</code> determined by select list.</p>
  
  <p><b>Contract.java</b></p>
  
  <pre><code>public class Contract {
      /* ... */
  
      //@NotNull
      @ManyToOne
      private Organization contractHolder;
  
      /* ... */
  }
  </code></pre>
  
  <p><b>Organization.java</b></p>
  
  <pre><code>public class Organization {
      /* ... */
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "id")
      private Long id;
  
      /* ... */
  }
  </code></pre>