Issue Details (XML | Word | Printable)

Key: NUCCORE-719
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Andy Jefferson
Reporter: subes
Votes: 0
Watchers: 0
Operations

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

Allow query extensions that are boolean to be specified with boolean value rather than "true", "false"

Created: 01/Jun/11 07:38 PM   Updated: 14/Jun/11 12:16 PM   Resolved: 07/Jun/11 09:47 AM
Component/s: Queries
Affects Version/s: None
Fix Version/s: 3.0.0.m5


 Description  « Hide
Currently I have to set:
query.setHint("datanucleus.query.results.cached", String.valueOf(true));

Desired would be if the following worked aswell:
query.setHint("datanucleus.query.results.cached", true);

To do this, the following change would be needed in org.datanucleus.store.query.Query.getBooleanExtensionProperty(...):
public boolean getBooleanExtensionProperty(String name, boolean resultIfNotSet)
    {
        if (extensions != null && extensions.containsKey(name))
        {
            Object value = extensions.get(name);
            if(value instanceof Boolean){
                return (boolean) value;
            } else {
                return Boolean.valueOf((String)value);
            }
        }
        else
        {
            return ec.getNucleusContext().getPersistenceConfiguration().getBooleanProperty(name, resultIfNotSet);
        }
    }

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 07/Jun/11 09:47 AM
SVN trunk supports Boolean values