[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4891?page=c...
]
Josh Moore commented on HHH-4891:
---------------------------------
Column "count" on PostgreSQL with 3.5.0-Final caused the same issue. Changing
the column name to "\"count\"" worked around the issue:
{code:java}
...
@javax.persistence.Column(name="\"count\"", ...)
...
public java.util.Map<Long, Long> getAnnotationLinksCountPerOwner() {
return this.annotationLinksCountPerOwner;
}
{code}
Using certain column names which mirror SQL function names causes
"ambiguous column" SQL errors
-----------------------------------------------------------------------------------------------
Key: HHH-4891
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4891
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-2, 3.5.0-Beta-3, 3.5.0-Beta-4
Environment: Error verified with Oracle, MySQL and H2 database engines.
Reporter: Manuel Dominguez Sarmiento
We have some columns names "floor" and "hash". This used to work fine
until 3.5.0 Beta 2. This and later releases fail when a query involves a join with two
tables and both each contain a column named either "floor" or "hash"
with an "ambiguous column" error.
3.5.0 Beta 1 and previous releases work fine. Something must have changed in Beta 2 that
is causing some kind of recognition of SQL function names, but I can't seem to
pinpoint any issue related to this in the changelong.
I'm pretty sure this would also happen with other column names such as
"ceil", "abs", etc. which although they might be SQL function names
they are not reserved keywords, and thus they are valid column names.
--
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