title: Spring JPA save transient entity
body: <p>in hibernate if I <code>persist</code> new entity it should become managed , moreover it should return the managed entity.</p>
  
  <p>if the entity is detached , the <code>merge</code> will return managed entity but the one that I passed will still detached. </p>
  
  <p>I've tried that in spring boot with hibernate and everything is working except the following case :</p>
  
  <pre><code>User transientUser=new User();
      transientUser.setId(9L);
      User managedTransientUser=userRepository.save(transientUser);
  </code></pre>
  
  <p>if I set the Id manually ( even with removing the auto generation) the entity that I pass ( transientUser) will still be unmanaged . If I use generation Identity then the returned and passed entity are the same ( the id is null and the DB will auto increment ) is that expected ?</p>