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);
        }
    }

Andy Jefferson made changes - 07/Jun/11 09:45 AM
Field Original Value New Value
Project DataNucleus API JPA [ 10171 ] DataNucleus Core [ 10143 ]
Key NUCJPA-132 NUCCORE-719
Affects Version/s 3.0.0.m4 [ 11227 ]
Component/s Queries [ 10154 ]
Component/s Queries [ 10180 ]
Andy Jefferson made changes - 07/Jun/11 09:46 AM
Summary QueryHint datanucleus.query.results.cached should not require a "String" to be set Allow query extensions that are boolean to be specified with boolean value rather than "true", "false"
Assignee Andy Jefferson [ andy ]
Fix Version/s 3.0.0.m5 [ 11242 ]
Andy Jefferson added a comment - 07/Jun/11 09:47 AM
SVN trunk supports Boolean values

Andy Jefferson made changes - 07/Jun/11 09:47 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 14/Jun/11 12:16 PM
Status Resolved [ 5 ] Closed [ 6 ]