- All Known Subinterfaces:
QueryMapper.MapperNotCondition
- Enclosing interface:
QueryMapper
public static interface QueryMapper.MapperNameCondition
Represents a condition based on a column name.
-
Method Summary
Modifier and TypeMethodDescriptionbetween(T valueA, T valueB) Creates a condition where the specified column value is between the two provided bounds.Creates a condition where the specified column contains the given substring.Creates a condition where the specified column ends with the given suffix.eq(T value) Creates a condition where the specified column value equals the given value.gt(T value) Creates a condition where the specified column value is greater than the given value.gte(T value) Creates a condition where the specified column value is greater than or equal to the given value.Creates a condition where the specified column value exists within the given collection.Creates a condition where the specified column value matches the provided pattern.lt(T value) Creates a condition where the specified column value is less than the given value.lte(T value) Creates a condition where the specified column value is less than or equal to the given value.not()Creates a negated condition for the current column, allowing inverse logic.startsWith(String value) Creates a condition where the specified column starts with the given prefix.
-
Method Details
-
eq
Creates a condition where the specified column value equals the given value. Example:template.select(User.class) .where("username").eq("alice") .result();- Type Parameters:
T- the type of the value to compare with the column value- Parameters:
value- the value for the comparison- Returns:
- the
QueryMapper.MapperWhereinstance for chaining - Throws:
NullPointerException- if value is null
-
gt
Creates a condition where the specified column value is greater than the given value. Example:template.select(Product.class) .where("price").gt(50) .result();- Type Parameters:
T- the type of the value to compare with the column value- Parameters:
value- the value for the comparison- Returns:
- the
QueryMapper.MapperWhereinstance for chaining - Throws:
NullPointerException- if value is null
-
gte
Creates a condition where the specified column value is greater than or equal to the given value.template.select(Product.class) .where("stock").gte(10) .result();- Type Parameters:
T- the type of the value to compare with the column value- Parameters:
value- the value for the comparison- Returns:
- the
QueryMapper.MapperWhereinstance for chaining - Throws:
NullPointerException- if value is null
-
lt
Creates a condition where the specified column value is less than the given value.template.select(Order.class) .where("totalAmount").lt(500) .result();- Type Parameters:
T- the type of the value to compare with the column value- Parameters:
value- the value for the comparison- Returns:
- the
QueryMapper.MapperWhereinstance for chaining - Throws:
NullPointerException- if value is null
-
lte
Creates a condition where the specified column value is less than or equal to the given value.template.select(Customer.class) .where("age").lte(30) .result();- Type Parameters:
T- the type of the value to compare with the column value- Parameters:
value- the value for the comparison- Returns:
- the
QueryMapper.MapperWhereinstance for chaining - Throws:
NullPointerException- if value is null
-
like
Creates a condition where the specified column value matches the provided pattern.template.select(Book.class) .where("title").like("Java") .result();- Parameters:
value- the pattern value to match- Returns:
- the
QueryMapper.MapperWhereinstance for chaining - Throws:
NullPointerException- if value is null
-
contains
Creates a condition where the specified column contains the given substring. This is useful for filtering results where a column includes the given text fragment anywhere within its value.- Parameters:
value- the substring to search for within the column- Returns:
- the
QueryMapper.MapperWhereinstance for further condition chaining - Throws:
NullPointerException- ifvalueisnulltemplate.select(Book.class) .where("title").contains("Java") .result();
-
startsWith
Creates a condition where the specified column starts with the given prefix. This is useful for filtering results where a column begins with a specific value.- Parameters:
value- the prefix to match at the beginning of the column- Returns:
- the
QueryMapper.MapperWhereinstance for further condition chaining - Throws:
NullPointerException- ifvalueisnullExample:
template.select(User.class) .where("username").startsWith("admin") .result();
-
endsWith
Creates a condition where the specified column ends with the given suffix. This is useful for filtering results where a column ends with a specific value.- Parameters:
value- the suffix to match at the end of the column- Returns:
- the
QueryMapper.MapperWhereinstance for further condition chaining - Throws:
NullPointerException- ifvalueisnullExample:
template.select(Document.class) .where("filename").endsWith(".pdf") .result();
-
between
Creates a condition where the specified column value is between the two provided bounds.template.select(Product.class) .where("price").between(10, 100) .result();- Type Parameters:
T- the type of the value to compare with the column value- Parameters:
valueA- the lower boundvalueB- the upper bound- Returns:
- the
QueryMapper.MapperWhereinstance for chaining - Throws:
NullPointerException- if either valueA or valueB is null
-
in
Creates a condition where the specified column value exists within the given collection.template.select(Product.class) .where("category").in(List.of("book", "electronics")) .result();- Type Parameters:
T- the type of the value to compare with the column value- Parameters:
values- the collection of values to match- Returns:
- the
QueryMapper.MapperWhereinstance for chaining - Throws:
NullPointerException- if values is null
-
not
Creates a negated condition for the current column, allowing inverse logic.template.select(User.class) .where("active").not().eq(true) .result();- Returns:
- the
QueryMapper.MapperNotConditionto continue building a negated expression
-