Class QueryHelper
- java.lang.Object
-
- fr.gouv.vitam.common.database.builder.query.QueryHelper
-
- Direct Known Subclasses:
QueryParserHelper
public class QueryHelper extends java.lang.Object
Query helper (common to all types: SELECT, UPDATE, INSET, DELETE)
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
QueryHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static BooleanQuery
and()
static CompareQuery
eq(java.lang.String variableName, boolean value)
static CompareQuery
eq(java.lang.String variableName, double value)
static CompareQuery
eq(java.lang.String variableName, long value)
static CompareQuery
eq(java.lang.String variableName, java.lang.String value)
static CompareQuery
eq(java.lang.String variableName, java.util.Date value)
static ExistsQuery
exists(java.lang.String variableName)
static MltQuery
flt(java.lang.String value, java.lang.String... variableName)
static CompareQuery
gt(java.lang.String variableName, boolean value)
static CompareQuery
gt(java.lang.String variableName, double value)
static CompareQuery
gt(java.lang.String variableName, long value)
static CompareQuery
gt(java.lang.String variableName, java.lang.String value)
static CompareQuery
gt(java.lang.String variableName, java.util.Date value)
static CompareQuery
gte(java.lang.String variableName, boolean value)
static CompareQuery
gte(java.lang.String variableName, double value)
static CompareQuery
gte(java.lang.String variableName, long value)
static CompareQuery
gte(java.lang.String variableName, java.lang.String value)
static CompareQuery
gte(java.lang.String variableName, java.util.Date value)
static InQuery
in(java.lang.String variableName, boolean... value)
static InQuery
in(java.lang.String variableName, double... value)
static InQuery
in(java.lang.String variableName, long... value)
static InQuery
in(java.lang.String variableName, java.lang.String... value)
static InQuery
in(java.lang.String variableName, java.util.Date... value)
static ExistsQuery
isNull(java.lang.String variableName)
static CompareQuery
lt(java.lang.String variableName, boolean value)
static CompareQuery
lt(java.lang.String variableName, double value)
static CompareQuery
lt(java.lang.String variableName, long value)
static CompareQuery
lt(java.lang.String variableName, java.lang.String value)
static CompareQuery
lt(java.lang.String variableName, java.util.Date value)
static CompareQuery
lte(java.lang.String variableName, boolean value)
static CompareQuery
lte(java.lang.String variableName, double value)
static CompareQuery
lte(java.lang.String variableName, long value)
static CompareQuery
lte(java.lang.String variableName, java.lang.String value)
static CompareQuery
lte(java.lang.String variableName, java.util.Date value)
static MatchQuery
match(java.lang.String variableName, java.lang.String value)
static MatchQuery
matchAll(java.lang.String variableName, java.lang.String value)
static MatchQuery
matchPhrase(java.lang.String variableName, java.lang.String value)
static MatchQuery
matchPhrasePrefix(java.lang.String variableName, java.lang.String value)
static ExistsQuery
missing(java.lang.String variableName)
Deprecated.Use $not + $existsstatic MltQuery
mlt(java.lang.String value, java.lang.String... variableName)
static CompareQuery
ne(java.lang.String variableName, boolean value)
static CompareQuery
ne(java.lang.String variableName, double value)
static CompareQuery
ne(java.lang.String variableName, long value)
static CompareQuery
ne(java.lang.String variableName, java.lang.String value)
static CompareQuery
ne(java.lang.String variableName, java.util.Date value)
static NestedQuery
nestedSearch(java.lang.String variableName, com.fasterxml.jackson.databind.JsonNode value)
static InQuery
nin(java.lang.String variableName, boolean... value)
static InQuery
nin(java.lang.String variableName, double... value)
static InQuery
nin(java.lang.String variableName, long... value)
static InQuery
nin(java.lang.String variableName, java.lang.String... value)
static InQuery
nin(java.lang.String variableName, java.util.Date... value)
static BooleanQuery
not()
static BooleanQuery
or()
static PathQuery
path(java.lang.String... pathes)
static RangeQuery
range(java.lang.String variableName, double min, boolean includeMin, double max, boolean includeMax)
static RangeQuery
range(java.lang.String variableName, long min, boolean includeMin, long max, boolean includeMax)
static RangeQuery
range(java.lang.String variableName, java.lang.String min, boolean includeMin, java.lang.String max, boolean includeMax)
static RangeQuery
range(java.lang.String variableName, java.util.Date min, boolean includeMin, java.util.Date max, boolean includeMax)
static SearchQuery
regex(java.lang.String variableName, java.lang.String value)
static SearchQuery
search(java.lang.String variableName, java.lang.String value)
static CompareQuery
size(java.lang.String variableName, long value)
static TermQuery
term(java.lang.String variableName, boolean value)
static TermQuery
term(java.lang.String variableName, double value)
static TermQuery
term(java.lang.String variableName, long value)
static TermQuery
term(java.lang.String variableName, java.lang.String value)
static TermQuery
term(java.lang.String variableName, java.util.Date value)
static TermQuery
term(java.util.Map<java.lang.String,java.lang.Object> variableNameValue)
static WildcardQuery
wildcard(java.lang.String variableName, java.lang.String value)
-
-
-
Method Detail
-
path
public static final PathQuery path(java.lang.String... pathes) throws InvalidCreateOperationException
- Parameters:
pathes
- primary list of path in the future PathQuery- Returns:
- a PathQuery
- Throws:
InvalidCreateOperationException
- when creating query errors
-
and
public static final BooleanQuery and() throws InvalidCreateOperationException
- Returns:
- a BooleanQuery for AND operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
or
public static final BooleanQuery or() throws InvalidCreateOperationException
- Returns:
- a BooleanQuery for OR operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
not
public static final BooleanQuery not() throws InvalidCreateOperationException
- Returns:
- a BooleanQuery for NOT operator (using AND internally)
- Throws:
InvalidCreateOperationException
- when creating query errors
-
eq
public static final CompareQuery eq(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.util.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.util.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.util.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.util.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.util.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.util.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(java.lang.String variableName, long value) throws InvalidCreateOperationException
- Parameters:
variableName
- key namevalue
- of key- Returns:
- a CompareQuery using SIZE comparator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
exists
public static final ExistsQuery exists(java.lang.String variableName) throws InvalidCreateOperationException
- Parameters:
variableName
- key name- Returns:
- an ExistsQuery
- Throws:
InvalidCreateOperationException
- using Exists operator
-
missing
@Deprecated public static final ExistsQuery missing(java.lang.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
public static final ExistsQuery isNull(java.lang.String variableName) throws InvalidCreateOperationException
- Parameters:
variableName
- key name- Returns:
- an ExistsQuery using isNull operator
- Throws:
InvalidCreateOperationException
- when creating query errors
-
in
public static final InQuery in(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.util.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.util.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String variableName, java.lang.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(java.lang.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(java.lang.String variableName, java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.util.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(java.util.Map<java.lang.String,java.lang.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(java.lang.String variableName, java.lang.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(java.lang.String value, java.lang.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(java.lang.String value, java.lang.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(java.lang.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(java.lang.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(java.lang.String variableName, java.lang.String min, boolean includeMin, java.lang.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(java.lang.String variableName, java.util.Date min, boolean includeMin, java.util.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
-
-