[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2541) no-arg function inside "vector expression" not properly replaced with Dialect function mappings

Steve Ebersole (JIRA) noreply at atlassian.com
Tue Apr 3 11:17:04 EDT 2007


no-arg function inside "vector expression" not properly replaced with Dialect function mappings
-----------------------------------------------------------------------------------------------

                 Key: HHH-2541
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2541
             Project: Hibernate3
          Issue Type: Bug
          Components: query-hql
            Reporter: Steve Ebersole
            Assignee: Steve Ebersole
            Priority: Minor


For an example of this, see org.hibernate.test.component.basic.ComponentTest#testComponentQueries against a Sybase database.  

The issue is the third query in that test: from Employee e where e.person = ('steve', current_timestamp)

The first grammar (hql.g) is currently the one responsible for deciding whether an IDENT node represents a METHOD_CALL.  However, it currently does this by seeing if the IDENT is immediately followed by an '('.  Here, the current_timestamp method call is not because it is no-arg and so hql.g does not retask the IDENT as a METHOD_CALL.  And actually this is correct.  The code in hql.g is simply trying to get the common case.  And we do not want to blindly look up the IDENT text in the Dialect to see if it matches a mapped function name (because it might also represent a property name, which should take precedence).

The solution is to account for this in the second grammar (hql-sql.g) during recognition of a vector expression.  Actually, the correct correct solution is better precedented recognition of atomic expressions...

-- 
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