Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Kaarel Kann
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Boolean fields are left as null when selecting objects using SQL query

Created: 22/Apr/14 09:26 AM   Updated: 10/Aug/14 12:57 PM   Resolved: 07/Aug/14 07:54 AM
Component/s: ORM
Affects Version/s: 3.2.12
Fix Version/s: 4.0.2

File Attachments: 1. Java Source File (3 kB)
2. Zip Archive (9 kB)

Environment: Any

Severity: Development

 Description  « Hide
Boolean fields are not mapped correctly when selecting with SQL query. They work fine with JDOQL queries.

Sort Order: Ascending order - Click to sort in descending order
Kaarel Kann added a comment - 22/Apr/14 09:27 AM
Attached testcases (including entire testcase project)

Kaarel Kann added a comment - 22/Apr/14 09:28 AM
Problematic for databases that don't have BOOLEAN data type (e.g Oracle).

Andy Jefferson added a comment - 04/Aug/14 08:12 PM
i.e user stores a column as an integer/long, and expects it to magically be converted back to Boolean (nothing in the spec to expect that). Simply adding a method setXXX (to the result class) that takes in an integer/long and does the mapping (to boolean) would solve that. Some code is now in ClassUtils.convertValue to attempt such things also.