title: Can Hibernate handle overlapping columns in composite types?
body: <p>There is a known hibernate bug <a href="https://hibernate.atlassian.net/browse/HHH-6221" rel="nofollow noreferrer">https://hibernate.atlassian.net/browse/HHH-6221</a> where overlapping foreign keys triggers an AnnotationException. In <code>@JoinColumns</code>, you cannot have a mix of insertable and non-insertable <code>@JoinColumn</code> entries.</p>
  <p>This has a workaround using <code>@JoinColumnsOrFormulas</code>, <a href="https://stackoverflow.com/a/13147366/16400385">https://stackoverflow.com/a/13147366/16400385</a> .</p>
  <p>The same bug is there for <code>@Columns</code>, but I can't find a <code>@ColumnsOrFormulas</code> annotation. Is there a similar workaround for <code>@Columns</code> ?</p>
  <p>sample code</p>
  <pre><code>    @Columns( columns = {
          @Column(name = &quot;currency_id&quot;, updatable = false, insertable = false),
          @Column(name = &quot;fees&quot;)
      })
      private Money fees;
  
      @Columns( columns = {
              @Column(name = &quot;currency_id&quot;),
              @Column(name = &quot;tax&quot;)
      })
      private Money tax;
  </code></pre>
  <p>the error I get is</p>
  <blockquote>
  <p>'org.hibernate.AnnotationException: Mixing insertable and non
  insertable columns in a property is not allowed'</p>
  </blockquote>
  <p>, same as HHH-6221</p>