From: Sebastien C. (JIRA) <no...@at...> - 2006-06-23 12:43:37
|
Query on a one-to-one association with foreign generator does not work ---------------------------------------------------------------------- Key: HHH-1849 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1849 Project: Hibernate3 Type: Bug Components: core Versions: 3.2.0.cr2 Environment: There is no exception under hsqldb but there is one with msde or firebird. Reporter: Sebastien Cesbron Attachments: test-foreign.zip I have 2 classes Master and Slave with Master that has a foreign generator on slave. <class name="Master"> <id name="oid"> <generator class="foreign"> <param name="property">slave</param> </generator> </id> <property name="libelle" type="string" /> <one-to-one name="slave" class="Slave" constrained="true"/> </class> If I do : query = session.createQuery("from Master master where master.slave=:slave"); query.setParameter("slave", slave); query.list(); There is a problem because the parameter is not set. Under hsqldb, there is no exception but the query return nothing. Under msde or firebird there is an exception. Under firebird it is "org.firebirdsql.jdbc.FBMissingParameterException: Not all parameters were set.". The same query on slave's oid works : query = session.createQuery("from Master master where master.slave.oid=:oid"); query.setParameter("oid", 1); query.list(); I've attached a simple project that shows the problem. I have tested this project with hibernate 3.0.5 and hibernate 3.2.0cr2. It works with the first one but not with the latter one. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |