title: Repeated column in mapping for entity
body: <p>When I persist a <code>WorkAction</code> I need to store the FK Id for <code>WorkflowInstance</code></p>
  
  <pre><code>WorkAction wa = new WorkAction();
  wa.setWorkflowInstance(wfi);
  waDao.persist(wa);
  </code></pre>
  
  <p>However in the table for <code>WorkAction</code> the fk column, <code>workflow_instance_id</code> winds up being null.</p>
  
  <p>Turns out in the Entity for <code>WorkAction</code> I had mapped <code>WorkflowInstance</code> using <code>, insertable = false, updatable = false</code> like this </p>
  
  <pre><code>@ManyToOne
  @JoinColumn(name = "workflow_instance_id", referencedColumnName = "workflow_instance_id", insertable = false, updatable = false)
  private WorkflowInstance workflowInstance;
  </code></pre>
  
  <p>When I removed it, I got the <code>Repeated column in mapping for entity: WorkAction column: workflow_instance_id</code>  But in the <code>WorkAction</code> entity I didn't see <code>workflow_instance_id</code> mapped again , i.e. I did not have <code>private Long workflow_instance_id;</code></p>
  
  <p>But then I noticed in my <code>WorkAction</code> entity, I had mapped a <code>WorkflowInstancePlayer</code> using a formula which referenced <code>workflow_instamce_id</code> </p>
  
  <pre><code>@ManyToOne(fetch = FetchType.LAZY)
  @JoinColumnsOrFormulas({ @JoinColumnOrFormula(formula = @JoinFormula(value = "(SELECT a.role_class_id FROM WF_WORK_ACTION_CLASS a WHERE a.work_action_class_id = work_action_class_id)", referencedColumnName = "role_class_id")),
          @JoinColumnOrFormula(column = @JoinColumn(name = "workflow_instance_id", referencedColumnName = "workflow_instance_id", insertable=false, updatable=false)) })
  private WorkflowInstancePlayer player;
  </code></pre>
  
  <p>Even after adding <code>insertable=false, updatable=false</code> to that mapping I still have the issue.  When I comment out the <code>@JoinColumnsOrFormulas</code> I can remove the <code>insertable=false, updatable=false</code> on the <code>WorkflowInstance</code> and the workflow_instance_id is then not null but I then lose my <code>WorkflowInstancePlayer</code></p>
  
  <p>How do I get around this?</p>