Following is my entity class where I am using @OneToMany annotation, which leads to incorrect binding. ref_no and seq_no are my binding parameters. But the binding values are out of order. Value for ref_no binds with seq_no and value for seq_no binds with ref_no.
Output trace log(incorrect binding): Hibernate: select p1_0.seq_no,p1_0.ref_no,p1_0.party_code,p1_0.party_id from rbi_trade.ot_txn_party p1_0 where (p1_0.seq_no,p1_0.ref_no) in((?,?)) 2023-03-09T08:31:42.540+01:00 TRACE 15588 — [ scheduling-1] org.hibernate.orm.jdbc.bind : binding parameter [1] as [VARCHAR] - [*E313100005323221237*] 2023-03-09T08:31:42.540+01:00 TRACE 15588 — [ scheduling-1] org.hibernate.orm.jdbc.bind : binding parameter [2] as [VARCHAR] - [*001*] In the same entity class I am also using @OnetoOne annotation with multiple join columns as follows, which works perfectly fine and leads to the correct binding parameters values `
Output trace log (correct binding): Hibernate: select i1_0.ref_no,i1_0.seq_no,i1_0.reg_by from rbi_trade.ot_workunit i1_0 where (i1_0.ref_no,i1_0.seq_no) in((?,?)) 2023-03-09T08:31:42.524+01:00 TRACE 15588 — [ scheduling-1] org.hibernate.orm.jdbc.bind : binding parameter [1] as [VARCHAR] - [*E313100005323221237*] 2023-03-09T08:31:42.525+01:00 TRACE 15588 — [ scheduling-1] org.hibernate.orm.jdbc.bind : binding parameter [2] as [VARCHAR] - [*001*] I am facing this issue since I upgraded to spring boot jpa 3.0.2. I was using version 2.7.2 before where the binds with @OneToMany also worked fine. |