Some query fail in BinaryLogicOperatorNode.mutateRowValueConstructorSyntaxesIfNecessary
when there is a one-to-one bidi relation.
---------------------------------------------------------------------------------------------------------------------------------
Key: HHH-3199
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3199
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.6
Environment: Hibernate version 3.2.6.ga. Database postgreSQL,
Reporter: Benjamin Lerman
Attachments: example.zip
When mapping a one-to-one bidi relation with the following mappings :
<hibernate-mapping>
<class lazy="true"
name="com.genia.toolbox.model.association.one_to_one_bidi.impl.DriverOneToOneBidiImpl"
proxy="com.genia.toolbox.model.association.one_to_one_bidi.DriverOneToOneBidi"
table="_driver_one_to_one_bidi">
<id name="identifier" column="_identifier"
type="java.lang.Long" unsaved-value="null">
<generator class="hilo"><param
name="table">_hibernate_unique_key_169</param></generator>
</id>
<one-to-one cascade="persist,merge,save-update"
class="com.genia.toolbox.model.association.one_to_one_bidi.impl.CarOneToOneBidiImpl"
name="carInternal" property-ref="driverInternal"/>
</class>
</hibernate-mapping>
and
<hibernate-mapping>
<class lazy="true"
name="com.genia.toolbox.model.association.one_to_one_bidi.impl.CarOneToOneBidiImpl"
proxy="com.genia.toolbox.model.association.one_to_one_bidi.CarOneToOneBidi"
table="_car_one_to_one_bidi">
<id name="identifier" column="_identifier"
type="java.lang.Long" unsaved-value="null">
<generator class="hilo"><param
name="table">_hibernate_unique_key_181</param></generator>
</id>
<many-to-one cascade="persist,merge,save-update"
class="com.genia.toolbox.model.association.one_to_one_bidi.impl.DriverOneToOneBidiImpl"
name="driverInternal" column="_driver" unique="true"/>
</class>
</hibernate-mapping>
the following query:
FROM com.genia.toolbox.model.association.one_to_one_bidi.DriverOneToOneBidi AS a2,
com.genia.toolbox.model.association.one_to_one_bidi.CarOneToOneBidi AS a3 WHERE
((a2.carInternal)=(a3))
failed with an exception:
left and right hand sides of a binary logic operator were incompatibile
This is due to the call to the method mutateRowValueConstructorSyntaxesIfNecessary of
BinaryLogicOperatorNode.
One of the type is a OneToOneType which returns 0 for getColumnSpan while the other is a
ManyToOneType that returns 1. The two values are not equal and an exception is thrown.
I join to this issue the relevant classes and mappings.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira