title: Insert entity with join columns
body: <p>I want to insert in database the entity "CategorieTresorerie" having two join columns. The problem is, one of them (RegroupementCategorieTresorerie) is trying to insert automatically... But this one is already in database, so i have a  duplicate key value violation exception.</p>
  
  <p>Error code:</p>
  
  <pre><code>Hibernate: insert into "RegroupementCategorieTresorerie" ("RegroupementCategorieTresorerieCode") values (?)
  2015-12-29 15:32:05.207  WARN 6960 --- [tomcat-http--26] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 23505
  2015-12-29 15:32:05.208 ERROR 6960 --- [tomcat-http--26] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: duplicate key value violates unique constraint "RegroupementCategorieTresorerie_PK"
    Détail : Key ("RegroupementCategorieTresorerieCode")=(MARGE_BRUT) already exists.
  2015-12-29 15:32:05.210  INFO 6960 --- [tomcat-http--26] o.h.e.j.b.internal.AbstractBatchImpl     : HHH000010: On release of batch it still contained JDBC statements
  org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [RegroupementCategorieTresorerie_PK]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
  </code></pre>
  
  <p>Class I want to insert:</p>
  
  <pre><code>@Entity
  public class CategorieTresorerie
      {
      @Id
      @Column(name="CategorieTresorerieID")
      @SequenceGenerator(name = "CategorieTresorerie_CategorieTresorerieID_seq", sequenceName = "\"CategorieTresorerie_CategorieTresorerieID_seq\"", allocationSize = 1)
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CategorieTresorerie_CategorieTresorerieID_seq")
      private Integer categorieTresorerieId;
  
      @MapsId
      @ManyToOne(fetch = FetchType.EAGER)
      @JoinColumn(name = "regroupementCategorieTresorerieCode", insertable = false, updatable = false)
      @Fetch(FetchMode.JOIN)
      private RegroupementCategorieTresorerie regroupement;
  
      @MapsId
      @ManyToOne(fetch = FetchType.EAGER)
      @JoinColumn(name = "typeCategorieTresorerieId", insertable = false, updatable = false)
      @Fetch(FetchMode.JOIN)
      private TypeCategorieTresorerie typeCategorieTresorerie;
  
      private Boolean estActif = true;
  </code></pre>
  
  <p>Join class RegroupementCategorieTresorerie, is the one which hibernate try to insert automatically:</p>
  
  <pre><code>@Entity
  public class RegroupementCategorieTresorerie implements EstTraductible
  {
      @Id
      private String regroupementCategorieTresorerieCode;
  
      @Transient
      private String libelle;
  </code></pre>
  
  <p>Join column TypeCategorieTresorerie:</p>
  
  <pre><code>@Entity
  public class TypeCategorieTresorerie
      {
      @Id
      @Column(name = "TypeCategorieTresorerieID")
      private Integer typeCategorieTresorerieId;
  
      @ManyToOne(fetch = FetchType.EAGER)
      @JoinColumn(name = "CategorieTresorerieFamilleID", insertable = false, updatable = false)
      @Fetch(FetchMode.JOIN)
      private CategorieTresorerieFamille famille;
  </code></pre>
  
  <p>How can i do to insert CategorieTresorerie without automatically insert joined columns ? </p>
  
  <p>Thank you for your help.</p>