| Summary: | querying for a Boolean will create a ReportQuery that generates valid SQL but returns no results | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Matthew Denison <matthew.denison> | ||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||
| Status: | NEW --- | QA Contact: | |||||
| Severity: | minor | ||||||
| Priority: | P2 | CC: | adrian.goerler, christopher.delahunt, pawel.zak.pawel, s.merk, tom.ware | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows Vista | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Matthew Denison
Do you get a similar issue when running equivalent JPQL Hi Tom, Yes, the same result. JPQL produces another ReportQuery which returns no results. Running the SQL myself that is generated, which is the same SQL the CriteriaBuilder produced, produces a single boolean value so there should be something being returned but no joy. The boolean column I am querying on is a protected member of a MappedSuperclass. Would this cause any problems that you know of? At the moment, my workaround is to count the rows returned instead of asking for the boolean value itself. That works. Thanks! I am not aware of any issue with querying a protected member of a mapped superclass. Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines This issue is due to a fix put into TopLink Essentials (glassfish bug 295) to filter out duplicates hen Distinct is used. Unfortunately, the constant used to indicate a duplicate is ReportyQuery's static RESULT_IGNORED, which is set to Boolean.valueOf(true). This causes single Boolean values of True to be excluded from the returned results (in ReportyQuery's buildObjects method) Workaround is to return the entity and then get the boolean value from it directly. *** Bug 348874 has been marked as a duplicate of this bug. *** Created attachment 259759 [details] Patch for Bug 335797 - make Boolean instance unique Bug 340089 is another duplicate of this bug. I have attached a fix with minimal side effects to this bug report, perhaps voting with joined forces brings it in:). The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |