title: Getting MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails
body: <p>PFB the tables relation for which getting the MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails</p>
  
  <pre><code>@Entity
  @Table(name = "CNT_CONTROL_INSTANCE")
  public class ControlInstance {
      /** Added Generator strategy */
      @Id
      @GeneratedValue(generator = "gen")
      @GenericGenerator(name = "gen", strategy = "foreign", parameters = 
      @Parameter(name = "property", value = "variable"))
      private Long                id;
  
      @OneToOne(fetch = LAZY, cascade = ALL)
      @PrimaryKeyJoinColumn
      private Variable            variable;
  
      @OneToOne(fetch = LAZY, cascade = ALL, mappedBy = "controlInstance")
      private Attribute           attribute;
  }
  
  @Entity
  @Table(name = "DYF_ATTRIBUTE")
  public class Attribute {
      @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
      @PrimaryKeyJoinColumn
      private ControlInstance     controlInstance;
  }
  </code></pre>
  
  <p>Please let me know the issue and the solution? Issue as I checked in mysql the autoincrement counter for both the tables were not in sync.</p>