Get the {@link QueryParser} for given query type

@param clazz
@return {@link DefaultQueryParser} if no matching parser found
335364
public QueryParser getForClass(Class<? extends SolrDataQuery> clazz) {

		QueryParser queryParser = cache.get(clazz);
		if (queryParser == null) {
			for (QueryParserPair pair : parserPairs) {
				if (pair.canParser(clazz)) {
					this.cache.put(clazz, pair.getParser());
					queryParser = pair.getParser();
					break;
				}
			}
		}

		return queryParser != null ? queryParser : defaultQueryParser;
	}
1130105
public static Class<?> getPrimitiveClass(final Class<?> clazz) {

    if (clazz == null) {
      return null;
    }
    int index = ArrayUtils.indexOf(WRAPPER_CLASSES, clazz);
    if (index != ArrayUtils.INDEX_OF_NOT_FOUND) {
      return PRIMITIVE_CLASSES[index];
    }
    return clazz;
  }
1109625
@Deprecated
    // TODO: All lucene specific code (methods that accept lucene query as
    // parameter) from this class should go away
    // and should be moved to LuceneIndexer instead
    public final Map<String, Object> search(Class<?> clazz, String query)
    {

        return search(clazz, query, Constants.INVALID, Constants.INVALID, false);
    }
341775
public static List<Method> getAccessors(Class<?> clazz) {
    if (clazz == null) {
      throw new IllegalArgumentException("The 'clazz' parameter cannot be null.");
    }

    List<Method> methods = new ArrayList<>();
    for (Method method : clazz.getMethods()) {
      String methodName = method.getName();
      if (!"getClass".equals(methodName) && !"hashCode".equals(methodName) && method.getReturnType() != null
          && !Void.class.equals(method.getReturnType()) && method.getParameterTypes().length == 0
          && ((methodName.startsWith("get") && methodName.length() > 3)
              || (methodName.startsWith("is") && methodName.length() > 2)
              || (methodName.startsWith("has") && methodName.length() > 3))) {
        methods.add(method);
      }
    }

    // Order the methods alphabetically by name
    sort(methods, new Comparator<Method>() {
      /**
       * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
       */
      @Override
      public int compare(Method method1, Method method2) {
        return method1.getName().compareTo(method2.getName());
      }
    });

    return unmodifiableList(methods);
  }
1277436
public static Object defaultInstantiateDelegate(Class<?> clazz, List<FieldDeclaration> fieldDeclarations) {
    return defaultInstantiateDelegate(clazz.getName(), fieldDeclarations);
  }
77410
public final Map<String, Object> fetchRelation(Class<?> clazz, String query)
    {
        // TODO: need to return list.
        return search(clazz, query, Constants.INVALID, Constants.INVALID, true);
    }
1199633
public static QueryExprListener listener(QueryParser parser) {
        QueryExprListener listener = listener();
        parser.addParseListener(listener);
        return listener;
    }
42303
public final Map<String, Object> search(Class<?> clazz, String query, int start, int count, boolean fetchRelation)
    {
        if (indexer != null)
        {
            if (indexer.getClass().getName().equals(IndexingConstants.LUCENE_INDEXER))
            {
                return indexer != null ? ((com.impetus.kundera.index.lucene.Indexer) indexer).search(query, start,
                        count, fetchRelation, kunderaMetadata,
                        KunderaMetadataManager.getEntityMetadata(kunderaMetadata, clazz)) : null;
            }
            else
            {
                return indexer.search(clazz, KunderaMetadataManager.getEntityMetadata(kunderaMetadata, clazz), query,
                        start, count);
            }
        }
        return new HashMap<String, Object>();
    }
878777
final public Selector QueryExpr() throws ParseException {
                         Selector ans;
    ans = BooleanExpr();
    jj_consume_token(0);
                              {if (true) return ans;}
    throw new Error("Missing return statement in function");
  }
181433
public static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz) {
		Assert.notNull(clazz, "Class must not be null");
		return (clazz.isPrimitive() && clazz != void.class? primitiveTypeToWrapperMap.get(clazz) : clazz);
	}
973154
public static JRLogger getLogger(final Class<?> clazz) {

        JRLogger logger = loggerMap.get(clazz.getName());
        if (logger == null) {
            JRLogger newInstance = null;

            // Get the logger instance according to slf4j configuration
            final org.slf4j.Logger innerLogger = LoggerFactory.getLogger(clazz);

            if ("ch.qos.logback.classic.Logger".equals(innerLogger.getClass().getName())) {
                newInstance = new LogbackAdapter((ch.qos.logback.classic.Logger) innerLogger);
            } else {

                newInstance = new Slf4jAdapter(innerLogger);
            }

            final JRLogger oldInstance = loggerMap.putIfAbsent(clazz.getName(), newInstance);
            logger = oldInstance == null ? newInstance : oldInstance;
        }
        return logger;
    }
794471
static <T> EntityInfo<T> get(Class<T> clazz) {
        return entityInfos.get(clazz);
    }
569174
public static String getQuery(String clazzFieldName, String clazzName, String idFieldName, String idFieldValue)
    {
        StringBuffer sb = new StringBuffer("+");
        sb.append(clazzFieldName);
        sb.append(":");
        sb.append(clazzName);
        sb.append(" AND ");
        sb.append("+");
        sb.append(idFieldName);
        sb.append(":");
        sb.append(idFieldValue);
        return sb.toString();
    }
367793
public String findAll(final Class<?> clazz) {
    return new SQL() {
      {
        SELECT("*");
        FROM(EntityUtil.getTableName(clazz));
      }
    }.toString();
  }
927743
public Query getQueryImplementation(String jpaQuery, PersistenceDelegator persistenceDelegator, Class mappedClass,
            boolean isNative, final KunderaMetadata kunderaMetadata)
    {
        if (jpaQuery == null)
        {
            throw new QueryHandlerException("Query String should not be null ");
        }

        if (jpaQuery.trim().endsWith(Constants.SEMI_COLON))
        {
            throw new QueryHandlerException("unexpected char: ';' in query [ " + jpaQuery + " ]");
        }

        KunderaQuery kunderaQuery = null;
        ApplicationMetadata appMetadata = kunderaMetadata.getApplicationMetadata();
        String mappedQuery = appMetadata.getQuery(jpaQuery);

        isNative = mappedQuery != null ? appMetadata.isNative(jpaQuery) : isNative;

        EntityMetadata m = null;

        // In case of named native query
        if (!isNative)
        {
            kunderaQuery = new KunderaQuery(mappedQuery != null ? mappedQuery : jpaQuery, kunderaMetadata);
            KunderaQueryParser parser = new KunderaQueryParser(kunderaQuery);

            parser.parse();

            kunderaQuery.postParsingInit();
            m = kunderaQuery.getEntityMetadata();
        }
        else
        {
            // Means if it is a namedNativeQuery.
            if (appMetadata.isNative(jpaQuery))
            {
                mappedClass = appMetadata.getMappedClass(jpaQuery);
            }

            kunderaQuery = new KunderaQuery(jpaQuery, kunderaMetadata);

            kunderaQuery.isNativeQuery = true;

            m = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, mappedClass);

            Field entityClazzField = null;
            try
            {
                entityClazzField = kunderaQuery.getClass().getDeclaredField("entityClass");
                if (entityClazzField != null && !entityClazzField.isAccessible())
                {
                    entityClazzField.setAccessible(true);
                }

                entityClazzField.set(kunderaQuery, mappedClass);
            }
            catch (Exception e)
            {
                log.error(e.getMessage());
                throw new QueryHandlerException(e);
            }
        }

        Query query = null;

        try
        {
            query = getQuery(jpaQuery, persistenceDelegator, m, kunderaQuery, kunderaMetadata);
        }
        catch (Exception e)
        {
            log.error(e.getMessage());
            throw new QueryHandlerException(e);
        }
        return query;
    }
72925
public final QueryParser.f_return f() throws RecognitionException {
        QueryParser.f_return retval = new QueryParser.f_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token string_literal85=null;

        CommonTree string_literal85_tree=null;

        try {
            // src/riemann/Query.g:72:3: ( 'false' )
            // src/riemann/Query.g:72:5: 'false'
            {
            root_0 = (CommonTree)adaptor.nil();

            string_literal85=(Token)match(input,28,FOLLOW_28_in_f559); 
            string_literal85_tree = (CommonTree)adaptor.create(string_literal85);
            adaptor.addChild(root_0, string_literal85_tree);


            }

            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
1283258
public static String getQuery(String clazzFieldName, String clazzName, String idFieldName, Object idFieldValue,
            String entityClazz)
    {
        StringBuffer sb = new StringBuffer("+");
        sb.append(clazzFieldName);
        sb.append(":");
        sb.append(clazzName);
        sb.append(" AND ");
        sb.append("+");
        sb.append(idFieldName);
        sb.append(":");
        sb.append(idFieldValue);
        if (entityClazz != null)
        {
            sb.append(" AND ");
            sb.append("+");
            sb.append(IndexingConstants.ENTITY_CLASS_FIELD);
            sb.append(":");
            sb.append(entityClazz);
        }
        return sb.toString();
    }