[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4875?page=c...
]
Tomaž moved HSEARCH-451 to HHH-4875:
------------------------------------
Affects Version/s: (was: 3.2.0.CR1)
3.2.5
Component/s: (was: query)
query-sql
Requires Release Note: [Affirmative]
Key: HHH-4875 (was: HSEARCH-451)
Project: Hibernate Core (was: Hibernate Search)
NativeQuery alias on column
----------------------------
Key: HHH-4875
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4875
Project: Hibernate Core
Issue Type: Bug
Components: query-sql
Affects Versions: 3.2.5
Environment: OS: Win XP
Java: 1.6
Hibernate 3.2.5.ga
MySQL: 5.1
Reporter: Tomaž
Priority: Blocker
Original Estimate: 1 day
Remaining Estimate: 1 day
n a pure SQL I use alias on column(query is valid and server return true result) but
Hibernate throw exception.
Also the problem is that the Hibernate retrieve wrong values for columns with the same
name.
--------------------------------------------------
Example 1:
SQL = SELECT
organizacije.id,
koda.vrednost AS k,
tip.vrednost AS t
FROM
organizacije
LEFT JOIN
sif_kodorg AS koda
ON koda.id=organizacije.koda
LEFT JOIN
sif_tiporg AS tip
ON tip.id=organizacije.tip_org
WHERE
organizacije.id=64
EntityManager.createNativeQuery(SQL) // error
error: org.hibernate.exception.SQLGrammarException: could not execute query
------------------------------------------
Example 2:
SQL = SELECT
organizacije.id,
koda.vrednost,
tip.vrednost
FROM
organizacije
LEFT JOIN
sif_kodorg AS koda
ON koda.id=organizacije.koda
LEFT JOIN
sif_tiporg AS tip
ON tip.id=organizacije.tip_org
WHERE
organizacije.id=64
When retrieving result in a array I get the same value for both columns koda.vrednost,
tip.vrednost
-----------------------------------
Why is here involved Hibernate Grammar if it's just a pure SQL, so is there any
solutions how to retrieve values of columns with same name?
Regards, Tomaž
--
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