title: org.springframework.dao.DataIntegrityViolationException after update spring-boot from 2.1.x to 2.2.x using hibernate and spring-boot-data-jpa
body: <p>When trying to update spring-boot from version 2.1.12 to 2.2.4 got stuck on DataIntegrityViolationException when try to insert multiple objects into MySQL using JPA. </p>
  
  <p>Example object: </p>
  
  <pre><code>@Data
  @Entity
  @AllArgsConstructor
  @NoArgsConstructor
  @Builder(toBuilder = true)
  @Table(name = "user")public class User {
  
      @Id
      @Column(name = "id")
      @JsonProperty("id")
      private String id;
  
      @PrimaryKeyJoinColumn
      @OneToOne(cascade = CascadeType.ALL)
      @JsonProperty("status")
      private UserStatus status;
  
  }
  </code></pre>
  
  <p>And user status: </p>
  
  <pre><code>@Data
  @Entity
  @AllArgsConstructor
  @NoArgsConstructor
  @Table(name = "user_status")
  public class UserStatus {
  
      @Id
      @Column(name = "id")
      @JsonProperty("id")
      private String id;
  
      public UserStatus(String userId) {
          this.id = userId;
      }
  
  }
  </code></pre>
  
  <p>To insert object to mysql I use default jpa repository: </p>
  
  <pre><code>@Repository
  public interface UserRepository extends JpaRepository&lt;User, String&gt; { 
  }
  </code></pre>
  
  <p>With spring-boot-2.1.x <code>userRepository.save(user)</code> works fine but with 2.2.x it raises this exception: </p>
  
  <pre><code>org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
  </code></pre>
  
  <p>With this details in log: </p>
  
  <pre><code>Cannot add or update a child row: a foreign key constraint fails (`test`.`user_status`, CONSTRAINT `user_status_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user` (`id`) ON DELETE CASCADE)
  </code></pre>
  
  <p>If enable <code>spring.jpa.show-SQL: true</code> I found out that with spring-boot-2.2.x no insertion on <code>User</code> entity is happening but with old spring it is. </p>
  
  <p>I didn't find any major change in spring-boot connecting to hibernate as well as no major change in hibernate itself after the corresponding update. 
  Is there anything updated which is not described in release notes? </p>