<class name = "MaClasse" ...>
<id>
..
</id>
<one-to-one name="voie" class="HbVoie" cascade="none"/>
...
</class>
"SELECT voie FROM MaClass AS mclass JOIN mclass.voie AS voie"
returns nothing, but in the database there are some data corresponding to this query.
And furthermore, if I do my mapping like this :
<class name = "MaClasse" ...>
<id>
..
</id>
<property name="idVoie" column="ID_VOIE" type="java.lang.Long"/>
...
</class>
idVoie is a foreign key which references the primary of another table mapped by the JAVA class HbVoie.
and then if I do the query like this (the same query but with the new mapping) :
SELECT voie FROM MaClass AS mclass, HbVoie AS voie
WHERE MaClass.idVoie = voie.id
it returns something !! But when you read these two query you can see there are the same !
Why do I have this problem ?
thanks,
Nicolas
|