Arul Pragasam (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=59fd553...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMTc5ZGY0MGI5...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16849?atlOrigin=eyJpIjoiMTc5ZG...
) HHH-16849 (
https://hibernate.atlassian.net/browse/HHH-16849?atlOrigin=eyJpIjoiMTc5ZG...
) When we use partition key in join columns generated query is incorrect and its failing.
(
https://hibernate.atlassian.net/browse/HHH-16849?atlOrigin=eyJpIjoiMTc5ZG...
)
Change By: Arul Pragasam (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=59fd553...
)
I have two entities Contact/ContactEmail. Both has a partitionkey. When i update the
contact entity, the generated query is incorrect. I am using Spring Boot 3.1.0 and
Hibernate * 6.2.5. Final Fina*l
{noformat}Contact contact = salesContactRepository.findByIdAndAccountId(id, 2L).get();
contact.setFirstName("demo-2x");
Contact saved = salesContactRepository.save(salesContact);{noformat}
*Query generated*:
update contacts set first_name=? where id=? and account_id=? and account_id=?
*Exception*:
2023-06-26T15:37:09.802+05:30 ERROR 18627 --- [nio-8080-exec-2]
o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet]
in context with path [] threw exception [Request processing failed:
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute
statement [No value specified for parameter 4] [update contacts set first_name=? where
id=? and account_id=? and account_id=?]; SQL [update contacts set first_name=? where id=?
and account_id=? and account_id=?]] with root cause
I am able to replicate the issue with a valid testcase as well.
[
https://github.com/hibernate/hibernate-test-case-templates/pull/282|https...]
(
https://hibernate.atlassian.net/browse/HHH-16849#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16849#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100227- sha1:a102ba3 )