From: David D. (JIRA) <no...@at...> - 2006-07-28 19:43:38
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1794?page=comments#action_23767 ] David Donn commented on HHH-1794: --------------------------------- This issue also occurs when doing something like "select new SomeDTO(a, b) from A a join a.b b". b will always be null. > HQL query (list) that SELECTs instances mixed with scalars returns NULLs (instance mappings are in a one-to-one relation) > -------------------------------------------------------------------------------------------------------------------------- > > Key: HHH-1794 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1794 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.1.3 > Environment: Hibernate 3.1.3 > Postgres 8.1.2 > Java 1.5.0_06 > Reporter: Conor Tee > Attachments: hibernate-scalar-problem.tar.gz > > > Given that "a" is a table whose id is reflected in table "b" as a PRIMARY FOREIGN KEY. > Mapping a->b and b->a with the appropriate "one-to-one" mappings (I hope), then > "select a, b from A a join a.b b" > returns "a" and "b" instances correctly.. > However: (this is where I see the problem) > "select a, b, 'Some scalar' from A a join a.b b" or "select a, a.B, 'Some scalar' from A a" > returns "a" and the "scalar" correctly, but returns NULL for b! > Attached is a working example with a README, Postgres schema build script and ant "build & run" script -- 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 |