[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4052) Bug when use COALESCE combined with CAST(null as VARCHAR)

Wilson Penha (JIRA) noreply at atlassian.com
Tue Jul 21 21:16:14 EDT 2009


Bug when use COALESCE combined with CAST(null as VARCHAR)
---------------------------------------------------------

                 Key: HHH-4052
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4052
             Project: Hibernate Core
          Issue Type: Bug
    Affects Versions: 3.3.0.GA
         Environment: Windows, Java1.5, Tomcat5.5.25, postgres8
            Reporter: Wilson Penha


this expression bring me too much problem : COALESCE(CAST(p.birthDate AS VARCHAR)),''), birthDate is null in this case, so when I get a null value from a Date type or whatever other null value, it produce a NPE from CAST, so:

if I do COALESCE(p.dataNascimento,'') it's asking for a date value and bring me another error, so how can do that on HQL, bcz it works if I do the same directly on postgres.

I think this is a bug.

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