title: ORA-02292 when using Hibernate
body: <p>I am trying to implement a delete function but all I get is this ORA-02292 ERROR:</p>
  
  <pre><code>Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-02292: Integritäts-Constraint (VDMA.FK892DE8B473F40868) verletzt - untergeordneter Datensatz gefunden
  
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
  </code></pre>
  
  <p>I have an Entity (MainEntity) that has an n:m relationship with its child entity.</p>
  
  <p><strong>For example: A User can have multiple cars, each car can be driven by different users.</strong></p>
  
  <p>When a User is deleted, I want the associations between the User and the Car to be deleted as well.  That´s why I thought I could do the following :</p>
  
  <p><strong>User Entity</strong></p>
  
  <pre><code>@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  @JoinTable(name = "user_car", joinColumns = {@JoinColumn(name = DATABASE_COLUMN_ID, nullable = false, updatable = false) }, inverseJoinColumns = {@JoinColumn(name = DATABASE_COLUMN_TYPE_ID,
        nullable = true, updatable = false) })
  private Set&lt;UserCar&gt; userCars;
  </code></pre>
  
  <p><strong>Car Entity</strong></p>
  
  <pre><code>@ManyToMany(fetch = FetchType.LAZY, mappedBy = "userCars")
    private Set&lt;User&gt; users;
  </code></pre>
  
  <p>The result is :</p>
  
  <p>The tables get created, the data gets persisted - everything works fine.
  EXCEPT deleting entries: As soon as I try to delete a User and the User has a car (and therefore a user : car relationship) I do get the errors shown above.</p>
  
  <p>If the user doesn´t have any cars I can delete him without any issues. So the problem must be the constraint in the USER_CAR table.</p>