title: JPA insertable = false updatable = false id not updated on creation
body: <p>We have 2 entities with a @ManyToOne relationship.</p>
  
  <p>When we create an instance of EntityB within a @Transactional method, entityAId (insertable = false updatable = false), is not updated automatically - even though that the entityA instance was already persisted.</p>
  
  <p>Is there a way around this? Do we have to update it manually in the ctor?</p>
  
  <pre><code>@Entity
  public class EntityA {
  
      @Id
      @GeneratedValue
      private Long id;
  
      public EntityA() {
         super();
      }
      ...
  }
  
  @Entity
  public class EntityB {
  
      @Id
      @GeneratedValue
      private Long id;
  
      @ManyToOne(optional = true, fetch = FetchType.LAZY)
      private EntityA entityA;
      @Column(name = "entityA_id", insertable = false, updatable = false)
      private Long entityAId;    
  
      public EntityB() {
          super();
      }
  
      public EntityB(EntityA entityA) {
          super();
          this.entityA = EntityA;
      }
      ...
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> Also tried the following, but still entityAId = null within the transaction (even though entityA was persisted before).</p>
  
  <pre><code>@Entity
  public class EntityB {
  
      @Id
      @GeneratedValue
      private Long id;
  
      @ManyToOne(optional = false, fetch = FetchType.LAZY)
      @JoinColumn(name = "entityA_id", insertable = false, updatable = false)
      private EntityA entityA;
      @Column(name = "entityA_id")
      private Long entityAId;
     ...
  }
  </code></pre>