Interface QueryMapper.MapperUpdateNameCondition
- All Known Subinterfaces:
-
QueryMapper.MapperUpdateNotCondition
- Enclosing interface:
-
QueryMapper
public static interface QueryMapper.MapperUpdateNameCondition
Represents the predicate definition step of the fluent update API.
This step defines conditional expressions used to restrict which entities will be affected by an update operation. Each predicate applies to the previously specified field.
Predicate support and evaluation semantics depend on the
capabilities of the underlying database. Unsupported predicates
may result in an
UnsupportedOperationException.
This step is mutable and not thread-safe.
@Inject
Template template;
template.update(Book.class)
.set("published").to(true)
.where("author").eq("Ada")
.execute();
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbetween(T valueA, T valueB) Creates an update condition where the specified column is between the provided values.Creates an update condition where the specified column contains the given value.Creates an update condition where the specified column ends with the given value.eq(T value) Creates an update condition where the specified column name equals the provided value.gt(T value) Creates an update condition where the specified column is greater than the provided value.gte(T value) Creates an update condition where the specified column is greater than or equal to the provided value.Creates an update condition where the specified column value is contained in the provided values.Creates an update condition where the specified column matches the given pattern.lt(T value) Creates an update condition where the specified column is less than the provided value.lte(T value) Creates an update condition where the specified column is less than or equal to the provided value.not()Negates the next update condition.startsWith(String value) Creates an update condition where the specified column starts with the given value.
-
Method Details
-
eq
Creates an update condition where the specified column name equals the provided value.template.update(Book.class) .set("published").to(true) .where("author").eq("Ada") .execute();- Type Parameters:
-
T- the type - Parameters:
-
value- the value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
like
Creates an update condition where the specified column matches the given pattern.template.update(Book.class) .set("category").to("classic") .where("title").like("%Design%") .execute();- Parameters:
-
value- the pattern value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
contains
Creates an update condition where the specified column contains the given value.template.update(Book.class) .set("highlighted").to(true) .where("description").contains("DDD") .execute();- Parameters:
-
value- the value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
startsWith
Creates an update condition where the specified column starts with the given value.template.update(Book.class) .set("featured").to(true) .where("title").startsWith("Domain") .execute();- Parameters:
-
value- the prefix value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
endsWith
Creates an update condition where the specified column ends with the given value.template.update(Book.class) .set("archived").to(true) .where("title").endsWith("Java") .execute();- Parameters:
-
value- the suffix value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
gt
Creates an update condition where the specified column is greater than the provided value.template.update(Book.class) .set("discounted").to(true) .where("price").gt(50) .execute();- Type Parameters:
-
T- the type - Parameters:
-
value- the value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
gte
Creates an update condition where the specified column is greater than or equal to the provided value.template.update(Book.class) .set("discounted").to(true) .where("price").gte(30) .execute();- Type Parameters:
-
T- the type - Parameters:
-
value- the value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
lt
Creates an update condition where the specified column is less than the provided value.template.update(Book.class) .set("featured").to(true) .where("rating").lt(5) .execute();- Type Parameters:
-
T- the type - Parameters:
-
value- the value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
lte
Creates an update condition where the specified column is less than or equal to the provided value.template.update(Book.class) .set("featured").to(true) .where("rating").lte(4) .execute();- Type Parameters:
-
T- the type - Parameters:
-
value- the value for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when value is null
-
between
Creates an update condition where the specified column is between the provided values.template.update(Book.class) .set("recommended").to(true) .where("publishedYear").between(2015, 2025) .execute();- Type Parameters:
-
T- the type - Parameters:
valueA- the lower bound valuevalueB- the upper bound value- Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when any value is null
-
in
Creates an update condition where the specified column value is contained in the provided values.template.update(Book.class) .set("available").to(false) .where("category").in(List.of("legacy", "outdated")) .execute();- Type Parameters:
-
T- the type - Parameters:
-
values- the values for the condition - Returns:
-
the
QueryMapper.MapperUpdateWhere - Throws:
-
NullPointerException- when values is null
-
not
Negates the next update condition.template.update(Book.class) .set("archived").to(true) .where("author").not().eq("Ada") .execute();- Returns:
-
the
QueryMapper.MapperUpdateNotCondition
-