Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008 Erik Bengtson and others. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Contributors : 2008 Andy Jefferson - refactored JSON specific code to JSONUtils 2008 Andy Jefferson - compilation process ... /
 
 package org.datanucleus.store.json.query;
 
 import java.util.List;
 import java.util.Map;
 
 import  org.datanucleus.store.ExecutionContext;
JDOQL query for JSON datastores.
 
 public class JDOQLQuery extends AbstractJDOQLQuery
 {
    
Constructs a new query instance that uses the given persistence manager.

Parameters:
om the associated ObjectManager for this query.
 
     public JDOQLQuery(ExecutionContext om)
     {
         this(om, (JDOQLQuerynull);
     }

    
Constructs a new query instance having the same criteria as the given query.

Parameters:
om The ObjectManager
q The query from which to copy criteria.
 
     public JDOQLQuery(ExecutionContext omJDOQLQuery q)
     {
         super(omq);
     }

    
Constructor for a JDOQL query where the query is specified using the "Single-String" format.

Parameters:
om The persistence manager
query The query string
 
     public JDOQLQuery(ExecutionContext omString query)
     {
         super(omquery);
     }
 
     protected Object performExecute(Map parameters)
     {
         ClassLoaderResolver clr = .getClassLoaderResolver();
         Properties options = new Properties();
         ManagedConnection mconn = .getStoreManager().getConnection(,options);
         try
         {
             long startTime = System.currentTimeMillis();
             if (..isDebugEnabled())
             {
                 ..debug(LOCALISER.msg("021046""JDOQL"getSingleStringQuery(), null));
             }
             List candidates = null;
             if ( == null)
             {
                 // TODO Cater for "subclasses" flag
                 candidates = ((JsonPersistenceHandler)getStoreManager().getPersistenceHandler()).getObjectsOfCandidateType(mconnoptions);
             }
             else
             {
                 candidates = new ArrayList();
             }
 
             JavaQueryEvaluator resultMapper = new JDOQLEvaluator(thiscandidates,
                 parameters.getClassLoaderResolver());
            Collection results = resultMapper.execute(truetruetruetruetrue);
            if (..isDebugEnabled())
            {
                ..debug(LOCALISER.msg("021074""JDOQL"
                    "" + (System.currentTimeMillis() - startTime)));
            }
            return results;
        }
        finally
        {
            mconn.release();
        }
    }
New to GrepCode? Check out our FAQ X