1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.query

File QueryManager.java

 

Code metrics

0
0
0
1
65
11
0
-
-
0
-

Classes

Class Line # Actions
QueryManager 34 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.query;
21   
22    import java.util.Set;
23   
24    import org.xwiki.component.annotation.Role;
25   
26    /**
27    * This interface encapsulates methods for the management of search queries and is similar to JCR's
28    * <a href="http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/query/QueryManager.html">QueryManager</a>.
29    *
30    * @version $Id: 12cef636e62db22f284c460935de9fd584139d93 $
31    * @since 1.6M1
32    */
33    @Role
 
34    public interface QueryManager
35    {
36    /**
37    * Create query for given statement and language. Use createQuery("statement", Query.LANGUAGE). For example:
38    * createQuery("select doc.name from XWikiDocument doc", Query.HQL).
39    *
40    * @param statement query statement.
41    * @param language language of the query. Must be one of {@link #getLanguages()}. Use {@link Query}.LANGUAGE for
42    * indication.
43    * @return a Query object.
44    * @throws QueryException if language is not supported
45    */
46    Query createQuery(String statement, String language) throws QueryException;
47   
48    /**
49    * @param queryName name of named query.
50    * @return Query object.
51    * @throws QueryException if there is no query with that name
52    */
53    Query getNamedQuery(String queryName) throws QueryException;
54   
55    /**
56    * @return supported languages.
57    */
58    Set<String> getLanguages();
59   
60    /**
61    * @param language language to check.
62    * @return is language supported.
63    */
64    boolean hasLanguage(String language);
65    }