Support COALESCE as HQL function
Description
Environment
None
Activity
Show:
Oskar Berggren November 14, 2012 at 12:01 PM
Mass-closing issues resolved with no fix-version and untouched for 30 days.
Oskar Berggren January 17, 2012 at 4:16 PM
Both the following HQL queries work on 3.1:
"select coalesce(p.Surname, 'foo') from Person p"
"select p from Person p where coalesce(p.Surname, 'foo') = 'bar'"
From what I can see, coalesce() has been supported since 2006 at least. Closing as unreproducible.
Ricardo Peres January 17, 2012 at 3:48 PM
Although, I cannot use it, I always get an not viable exception...
Ricardo Peres January 17, 2012 at 3:32 PM
Just noticed, it is already registered on class Dialect (trunk)! Somebody must have done it without looking at the issue!
You can close this issue.
Oskar Berggren January 17, 2012 at 1:49 PM
I don't see any opposition really. Perhaps all that is required is for someone to submit a patch with a unit test or two, preferably as a pull request on github.
Who's Looking?
SQL standard defines the COALESCE operator, which should be implemented in most DBs. HQL should implement it.
I know we can always define it in a custom Dialect, but since this is standard, I think it should be supported by the core.