Wolfgang Klaus (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZGE5YzIwZGNk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15593?atlOrigin=eyJpIjoiZGE5Yz...
) HHH-15593 (
https://hibernate.atlassian.net/browse/HHH-15593?atlOrigin=eyJpIjoiZGE5Yz...
) Illegal Update-Statement generated (
https://hibernate.atlassian.net/browse/HHH-15593?atlOrigin=eyJpIjoiZGE5Yz...
)
Issue Type: Bug Affects Versions: 5.3.21, 5.6.12 Assignee: Unassigned Attachments:
hbex.zip Components: hibernate-core Created: 11/Oct/2022 00:20 AM Environment:
hibernate-orm: 5.3.21
JVM: OpenJDK Runtime Environment (build 1.8.0_232-b09)
OS: Microsoft Windows \[Version 10.0.19042.2006]
Database: HSQL Priority: Major Reporter: Wolfgang Klaus (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
The following Entities are given
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE
hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"><hibernate-mapping>
<class dynamic-insert="false" dynamic-update="true"
name="org.example.Nachricht" table="NACHRICHT">
<id column="LID" name="id" type="java.lang.Long"
unsaved-value="-1">
<generator class="increment">
</generator>
</id>
<property column="titel" insert="true" name="titel"
not-null="true" type="java.lang.String" update="true"/>
<many-to-one class="org.example.Portalnutzer" column="LSENDERID"
name="sender" not-found="ignore"
not-null="false"/>
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE
hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"><hibernate-mapping>
<class dynamic-insert="false" dynamic-update="true"
name="org.example.Portalnutzer" optimistic-lock="version"
table="PORTALNUZTER">
<id column="LID" name="id" type="java.lang.Long"
unsaved-value="-1">
<generator class="increment">
</generator>
</id>
<property column="name" insert="true" name="titel"
not-null="true" type="java.lang.String" update="true"/>
<set cascade="save-update" inverse="true"
name="gesendeteNachrichten">
<key column="LSENDERID"/>
<one-to-many class="org.example.Nachricht"/>
</set>
</class>
</hibernate-mapping>
Until Version 5.3.20.Final the following HQL-Statement generates a correct
SQL-Update-Statement
session.createQuery("update Nachricht set titel='abc' where
sender.id=:pnutzerid ");
Correct generated SQL-Statement is:
update NACHRICHT set titel='abc' where LSENDERID=?
After Upgrading to version 5.3.21.Final the same HQL generates the following wrong
SQL-Statement
update NACHRICHT cross join set titel='abc' where LID=?
Has this change been made deliberately or is it a bug?
A complete example to reproduce the error is attached. Change the hibernate-Version in the
pom.xml
(
https://hibernate.atlassian.net/browse/HHH-15593#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15593#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#100208- sha1:38b2e23 )