|
|
Change By: |
Gustavo Almeida |
Affects Version/s: |
5.2.5 |
Environment: |
Hibernate 5.2.5, Java 8, Oracle 9i r2 |
Priority: |
Major Trivial |
Issue Type: |
Bug Task |
Summary: |
Hibernate binds more parameters to a DELETE statement than the statement accepts. Delete this |
|
In a specific combination of entities, Hibernate tries to bind more parameters to a delete statement (generated by itself) than the statement supports, causing an SQLException in Oracle and possibly other databases.
Summarizing: Entity F has entities A and M as @ManyToOne @Ids. Both A and M have multiple attributes as @Ids. Some attributes of F are @JoinColumn for the relation with both A and M. When you try to delete F, Hibernate tries to bind these "shared" parameters twice, causing the error.
In the forum post below, there is a very simple example written specifically to reproduce this bug. It has all the code and logs needed. [http://stackoverflow.com/questions/41678855/hibernate-binding-more-parameters-to-a-query-than-it-should] |
|
|
|
|