title: JPA cascade type
body: <p>i cannot understand how the JPA cascade type works, 
  i have a Judgement class which has a ManyToOne relationship with another Class User, i have user created first and stored in user table, only when user make a judgement, a new record of judgement will be inserted to the judgement table with that user id(not but reinsert the same user to the user table again). so here is my declare in judgement class:</p>
  
  <pre><code>@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE}) @PrimaryKeyJoinColumn
  @JoinColumn(name = "user_id")
  private User judge;
  </code></pre>
  
  <p>but it complained</p>
  
  <pre><code>Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing  -- com.dyihi.recseva.model.Judgement.judge -&gt; com.dyihi.recseval.model.User
  </code></pre>
  
  <p>what's wrong here? thanks</p>