[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1794) HQL query (list) that SELECTs instances mixed with scalars returns NULLs (instance mappings are in a one-to-one relation)

anuj (JIRA) noreply at atlassian.com
Fri May 25 21:00:04 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27056 ] 

anuj commented on HHH-1794:
---------------------------

The same issue still appears is also true in Hibernate 3.2.3.

select a, a.B, 'Some scalar' from A a" returns NULL for b. 



> 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
>          Issue Type: Bug
>          Components: core
>    Affects 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

        



More information about the hibernate-issues mailing list