Class QueryParserHelper
java.lang.Object
fr.gouv.vitam.common.database.builder.query.QueryHelper
fr.gouv.vitam.common.database.parser.query.QueryParserHelper
Query from Parser Helper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final Query[]
analyzeArrayCommand
(BuilderToken.QUERY query, com.fasterxml.jackson.databind.JsonNode commands, VarNameAdapter adapter) Analyze an array of commandsstatic final CompareQuery
eq
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final ExistsQuery
exists
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final MltQuery
flt
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final BuilderToken.QUERY
getRequestId
(String queryroot) Compute the QUERY from commandstatic final CompareQuery
gt
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final CompareQuery
gte
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final InQuery
in
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) protected static boolean
static final ExistsQuery
isNull
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final CompareQuery
lt
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final CompareQuery
lte
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final MatchQuery
match
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final MatchQuery
matchAll
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final MatchQuery
matchPhrase
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final MatchQuery
matchPhrasePrefix
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final ExistsQuery
missing
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final MltQuery
mlt
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final CompareQuery
ne
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final SearchQuery
nestedSearch
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final InQuery
nin
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final NopQuery
nop()
Constructs a null operation (nop) query, meaning there is no 'where' demand.static final PathQuery
path
(com.fasterxml.jackson.databind.JsonNode array, VarNameAdapter adapter) static final Query
query
(String refCommand, com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) Transform command to querystatic final RangeQuery
range
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final SearchQuery
regex
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final SearchQuery
search
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final CompareQuery
size
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final TermQuery
term
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) static final WildcardQuery
wildcard
(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) Methods inherited from class fr.gouv.vitam.common.database.builder.query.QueryHelper
and, eq, eq, eq, eq, eq, exists, flt, gt, gt, gt, gt, gt, gte, gte, gte, gte, gte, in, in, in, in, in, isNull, lt, lt, lt, lt, lt, lte, lte, lte, lte, lte, match, matchAll, matchPhrase, matchPhrasePrefix, missing, mlt, ne, ne, ne, ne, ne, nestedSearch, nin, nin, nin, nin, nin, not, or, path, range, range, range, range, regex, search, size, term, term, term, term, term, term, wildcard
-
Constructor Details
-
QueryParserHelper
protected QueryParserHelper()
-
-
Method Details
-
path
public static final PathQuery path(com.fasterxml.jackson.databind.JsonNode array, VarNameAdapter adapter) - Parameters:
array
- primary list of path in the future PathQueryadapter
- VarNameAdapter- Returns:
- a PathQuery
-
eq
public static final CompareQuery eq(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a CompareQuery using EQ comparator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
ne
public static final CompareQuery ne(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a CompareQuery using NE comparator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
lt
public static final CompareQuery lt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a CompareQuery using LT (less than) comparator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
lte
public static final CompareQuery lte(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a CompareQuery using LTE (less than or equal) comparator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
gt
public static final CompareQuery gt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a CompareQuery using GT (greater than) comparator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
gte
public static final CompareQuery gte(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a CompareQuery using GTE (greater than or equal) comparator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
size
public static final CompareQuery size(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a CompareQuery using SIZE comparator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
exists
public static final ExistsQuery exists(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidCreateOperationException, InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- an ExistsQuery
- Throws:
InvalidCreateOperationException
- using Exists operatorInvalidParseOperationException
- if could not parse to JSON
-
missing
public static final ExistsQuery missing(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidCreateOperationException, InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- an ExistsQuery using Missing operator
- Throws:
InvalidCreateOperationException
- using Exists operatorInvalidParseOperationException
- if could not parse to JSON
-
isNull
public static final ExistsQuery isNull(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidCreateOperationException, InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- an ExistsQuery using isNull operator
- Throws:
InvalidCreateOperationException
- using Exists operatorInvalidParseOperationException
- if could not parse to JSON
-
in
public static final InQuery in(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- an InQuery using IN operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
nin
public static final InQuery nin(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- an InQuery using NIN (not in) operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
match
public static final MatchQuery match(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a MatchQuery using MATCH operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
matchAll
public static final MatchQuery matchAll(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a MatchQuery using MATCH operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
matchPhrase
public static final MatchQuery matchPhrase(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a MatchQuery using MATCH_PHRASE operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
matchPhrasePrefix
public static final MatchQuery matchPhrasePrefix(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a MatchQuery using MATCH_PHRASE_PREFIX operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
regex
public static final SearchQuery regex(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a SearchQuery using REGEX operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
search
public static final SearchQuery search(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a SearchQuery using SEARCH operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
nestedSearch
public static final SearchQuery nestedSearch(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a SearchQuery using nested search mode
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
term
public static final TermQuery term(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a TermQuery
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
wildcard
public static final WildcardQuery wildcard(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a WildcardQuery
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
flt
public static final MltQuery flt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a MltQuery using a FLT (fuzzy like this) operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
mlt
public static final MltQuery mlt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a MltQuery using a MLT (more like this) operator
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
range
public static final RangeQuery range(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException - Parameters:
command
- JsonNodeadapter
- VarNameAdapter- Returns:
- a RangeQuery
- Throws:
InvalidParseOperationException
- if could not parse to JSON
-
nop
Constructs a null operation (nop) query, meaning there is no 'where' demand.- Returns:
- a NopQuery
- Throws:
InvalidCreateOperationException
- using NOP operator
-
query
public static final Query query(String refCommand, com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException, InvalidCreateOperationException Transform command to query- Parameters:
refCommand
- ref of commandcommand
- commandadapter
- dapater- Returns:
- query
- Throws:
InvalidParseOperationException
- if could not parse to JSONInvalidCreateOperationException
- if could not create the query
-
getRequestId
public static final BuilderToken.QUERY getRequestId(String queryroot) throws InvalidParseOperationException Compute the QUERY from command- Parameters:
queryroot
- String- Returns:
- the QUERY
- Throws:
InvalidParseOperationException
- if queryroot could not parse to JSON
-
analyzeArrayCommand
public static final Query[] analyzeArrayCommand(BuilderToken.QUERY query, com.fasterxml.jackson.databind.JsonNode commands, VarNameAdapter adapter) throws InvalidParseOperationException, InvalidCreateOperationException Analyze an array of commands- Parameters:
query
- querycommands
- commandsadapter
- adapter- Returns:
- array of Queries
- Throws:
InvalidParseOperationException
- if could not parse to JSONInvalidCreateOperationException
- if could not create the query
-
isCommandAsFullText
-