Class QueryHelper
java.lang.Object
fr.gouv.vitam.common.database.builder.query.QueryHelper
- Direct Known Subclasses:
QueryParserHelper
Query helper (common to all types: SELECT, UPDATE, INSET, DELETE)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final BooleanQuery
and()
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final ExistsQuery
static final MltQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final InQuery
static final InQuery
static final InQuery
static final InQuery
static final InQuery
static final ExistsQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final MatchQuery
static final MatchQuery
static final MatchQuery
matchPhrase
(String variableName, String value) static final MatchQuery
matchPhrasePrefix
(String variableName, String value) static final ExistsQuery
Deprecated.Use $not + $existsstatic final MltQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final CompareQuery
static final NestedQuery
nestedSearch
(String variableName, com.fasterxml.jackson.databind.JsonNode value) static final InQuery
static final InQuery
static final InQuery
static final InQuery
static final InQuery
static final BooleanQuery
not()
static final BooleanQuery
or()
static final PathQuery
static final RangeQuery
static final RangeQuery
static final RangeQuery
static final RangeQuery
static final SearchQuery
static final SearchQuery
static final CompareQuery
Deprecated.static final TermQuery
static final TermQuery
static final TermQuery
static final TermQuery
static final TermQuery
static final TermQuery
static final WildcardQuery
-
Constructor Details
-
QueryHelper
protected QueryHelper()
-
-
Method Details
-
path
- Parameters:
pathes
- primary list of path in the future PathQuery- Returns:
- a PathQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
and
- Returns:
- a BooleanQuery for AND operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
or
- Returns:
- a BooleanQuery for OR operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
not
- Returns:
- a BooleanQuery for NOT operator (using AND internally)
- Throws:
InvalidCreateOperationException
- when creating query errors
-
eq
public static final CompareQuery eq(String variableName, boolean value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using EQ comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
eq
public static final CompareQuery eq(String variableName, long value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using EQ comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
eq
public static final CompareQuery eq(String variableName, double value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using EQ comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
eq
public static final CompareQuery eq(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using EQ comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
eq
public static final CompareQuery eq(String variableName, Date value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using EQ comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
ne
public static final CompareQuery ne(String variableName, boolean value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using NE (non equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
ne
public static final CompareQuery ne(String variableName, long value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using NE (non equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
ne
public static final CompareQuery ne(String variableName, double value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using NE (non equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
ne
public static final CompareQuery ne(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using NE (non equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
ne
public static final CompareQuery ne(String variableName, Date value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using NE (non equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lt
public static final CompareQuery lt(String variableName, boolean value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LT (less than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lt
public static final CompareQuery lt(String variableName, long value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LT (less than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lt
public static final CompareQuery lt(String variableName, double value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LT (less than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lt
public static final CompareQuery lt(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LT (less than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lt
public static final CompareQuery lt(String variableName, Date value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LT (less than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lte
public static final CompareQuery lte(String variableName, boolean value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LTE (less than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lte
public static final CompareQuery lte(String variableName, long value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LTE (less than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lte
public static final CompareQuery lte(String variableName, double value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LTE (less than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lte
public static final CompareQuery lte(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LTE (less than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
lte
public static final CompareQuery lte(String variableName, Date value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using LTE (less than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gt
public static final CompareQuery gt(String variableName, boolean value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GT (greater than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gt
public static final CompareQuery gt(String variableName, long value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GT (greater than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gt
public static final CompareQuery gt(String variableName, double value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GT (greater than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gt
public static final CompareQuery gt(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GT (greater than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gt
public static final CompareQuery gt(String variableName, Date value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GT (greater than) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gte
public static final CompareQuery gte(String variableName, boolean value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GTE (greater than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gte
public static final CompareQuery gte(String variableName, long value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GTE (greater than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gte
public static final CompareQuery gte(String variableName, double value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GTE (greater than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gte
public static final CompareQuery gte(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GTE (greater than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
gte
public static final CompareQuery gte(String variableName, Date value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using GTE (greater than or equal) comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
size
public static final CompareQuery size(String variableName, long value) throws InvalidCreateOperationException Deprecated.- Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using SIZE comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
exists
- Parameters:
variableName
- key name- Returns:
- an ExistsQuery
- Throws:
InvalidCreateOperationException
- using Exists operator
-
missing
@Deprecated public static final ExistsQuery missing(String variableName) throws InvalidCreateOperationException Deprecated.Use $not + $exists- Parameters:
variableName
- key name- Returns:
- an ExistsQuery using Missing operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
isNull
- Parameters:
variableName
- key name- Returns:
- an ExistsQuery using isNull operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
in
public static final InQuery in(String variableName, boolean... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using IN operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
in
public static final InQuery in(String variableName, long... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using IN operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
in
public static final InQuery in(String variableName, double... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using IN operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
in
public static final InQuery in(String variableName, String... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using IN operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
in
public static final InQuery in(String variableName, Date... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using IN operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
nin
public static final InQuery nin(String variableName, boolean... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using NIN (not in) operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
nin
public static final InQuery nin(String variableName, long... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using NIN (not in) operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
nin
public static final InQuery nin(String variableName, double... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using NIN (not in) operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
nin
public static final InQuery nin(String variableName, String... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using NIN (not in) operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
nin
public static final InQuery nin(String variableName, Date... value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- an InQuery using NIN (not in) operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
match
public static final MatchQuery match(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a MatchQuery using MATCH operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
matchAll
public static final MatchQuery matchAll(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a MatchQuery using MATCH operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
matchPhrase
public static final MatchQuery matchPhrase(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a MatchQuery using MATCH_PHRASE operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
matchPhrasePrefix
public static final MatchQuery matchPhrasePrefix(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a MatchQuery using MATCH_PHRASE_PREFIX operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
regex
public static final SearchQuery regex(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a SearchQuery using REGEX operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
search
public static final SearchQuery search(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a SearchQuery using SEARCH operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
nestedSearch
public static final NestedQuery nestedSearch(String variableName, com.fasterxml.jackson.databind.JsonNode value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a NestedQuery using Nested Search operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
term
public static final TermQuery term(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a TermQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
term
public static final TermQuery term(String variableName, long value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a TermQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
term
public static final TermQuery term(String variableName, double value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a TermQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
term
public static final TermQuery term(String variableName, boolean value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a TermQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
term
public static final TermQuery term(String variableName, Date value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a TermQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
term
public static final TermQuery term(Map<String, Object> variableNameValue) throws InvalidCreateOperationException- Parameters:
variableNameValue
- key nameValue Map of VariableName of Value- Returns:
- a TermQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
wildcard
public static final WildcardQuery wildcard(String variableName, String value) throws InvalidCreateOperationException - Parameters:
variableName
- key namevalue
- of key- Returns:
- a WildcardQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
flt
public static final MltQuery flt(String value, String... variableName) throws InvalidCreateOperationException - Parameters:
value
- of keyvariableName
- key name- Returns:
- a MltQuery using a FLT (fuzzy like this) operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
mlt
public static final MltQuery mlt(String value, String... variableName) throws InvalidCreateOperationException - Parameters:
value
- of keyvariableName
- key name- Returns:
- a MltQuery using a MLT (more like this) operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
range
public static final RangeQuery range(String variableName, long min, boolean includeMin, long max, boolean includeMax) throws InvalidCreateOperationException - Parameters:
variableName
- key namemin
- valueincludeMin
- include min valuemax
- valueincludeMax
- include max value- Returns:
- a RangeQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
range
public static final RangeQuery range(String variableName, double min, boolean includeMin, double max, boolean includeMax) throws InvalidCreateOperationException - Parameters:
variableName
- key namemin
- valueincludeMin
- include min valuemax
- valueincludeMax
- include max value- Returns:
- a RangeQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
range
public static final RangeQuery range(String variableName, String min, boolean includeMin, String max, boolean includeMax) throws InvalidCreateOperationException - Parameters:
variableName
- key namemin
- valueincludeMin
- include min valuemax
- valueincludeMax
- include max value- Returns:
- a RangeQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
range
public static final RangeQuery range(String variableName, Date min, boolean includeMin, Date max, boolean includeMax) throws InvalidCreateOperationException - Parameters:
variableName
- key namemin
- valueincludeMin
- include min valuemax
- valueincludeMax
- include max value- Returns:
- a RangeQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-