Bug 482885 - TypedQuery<Boolean> returns an Object of Type BigDecimal
Summary: TypedQuery<Boolean> returns an Object of Type BigDecimal
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-24 04:24 EST by Ste Go CLA
Modified: 2022-06-09 10:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ste Go CLA 2015-11-24 04:24:15 EST
I am trying to write a JPQL query which returns a `boolean`, but even if I specify the result class as `Boolean.class` my query is still returning an object of type `BigDecimal`. 

    TypedQuery<Boolean> q = em.createQuery(
        "SELECT CASE WHEN ( count(e) > 0 ) THEN TRUE ELSE FALSE END"                        
                        + "FROM MyEntity e "
                        , Boolean.class);                         
        // Fails, because BigDecimal cannot be converted to Boolean
        return q.getSingleResult();

EclipseLink, version: Eclipse Persistence Services - 2.6.0.v20150309-bf26070
Oracle 11g 

Similar issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=430541
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:10:47 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:15:59 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink