Interface QueryMapper.MapperUpdateSetStep

All Superinterfaces:
QueryMapper.MapperUpdateQueryBuild
Enclosing interface:
QueryMapper

public static interface QueryMapper.MapperUpdateSetStep extends QueryMapper.MapperUpdateQueryBuild
Represents the update assignment step of the fluent update API.

This step allows defining one or more field assignments for an update operation. From this point, additional assignments may be added, the update scope may be restricted using where(...), or the operation may be executed.

@Inject
Template template;

template.update(Book.class)
    .set("title").to("Domain-Driven Design with Java")
    .set("publishedYear").to(2025)
    .where("author").eq("Ada")
    .execute();
The returned instance is mutable and not thread-safe.
Since:
1.0.0
  • Method Details

    • set

      Starts a new field assignment for the update operation.
      template.update(Book.class)
          .set("title").to("Domain-Driven Design with Java")
          .execute();
      
      Parameters:
      name - the field name to be updated
      Returns:
      a step that allows assigning a value to the field
      Throws:
      NullPointerException - when the field name is null
    • where

      Defines a condition to restrict which entities will be updated.
      template.update(Book.class)
          .set("available").to(false)
          .where("category").eq("CLASSIC")
          .execute();
      
      Parameters:
      name - the field name used in the condition
      Returns:
      the conditional step of the update fluent API
      Throws:
      NullPointerException - when the field name is null