Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-21274

[GSS](7.4.z) HHH-13619 HHH-13944 HHH-14533 size() does not work properly as select expression

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • Hibernate
    • None
    • +
    • Hide

      I'm attaching a reproducer.

      Show
      I'm attaching a reproducer. Configure the datasource MSSQLDS send a POST request to http://localhost:8080/companies to insert the data to test send a GET request to http://localhost:8080/companies/test (It will return a wrong result)

      I'm using the following HQL and it return a correct result :

      select distinct new net.rhuanrocha.dto.CompanyDto(c.id,c.name,0) 
          from Company c left join c.customers cu
                where c.name =:name 
                group by c.id, c.name 
      
      

      But when I use the size function in my HQL the query results is wrong (In my case is returning an empty result). Look this HQL:

      select distinct new net.rhuanrocha.dto.CompanyDto(c.id,c.name,size(c.customers)) 
          from Company c left join c.customers cu
                where c.name =:name 
                group by c.id, c.name 
      

              gbadner@redhat.com Gail Badner (Inactive)
              rhn-support-ivassile Ilia Vassilev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: