[
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-451?pag...
]
Sanne Grinovero commented on HSEARCH-451:
-----------------------------------------
Hi Tomaž,
thanks for reporting but this is the wrong issue tracker, this is about Search (fulltext
search) only.
Could you please report it to
http://opensource.atlassian.com/projects/hibernate/browse/HHH ?
NativeQuery alias on column
----------------------------
Key: HSEARCH-451
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-451
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.2.0.CR1
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