Class SqlUpdateQuery

All Implemented Interfaces:
ModifyQuery, Query, UpdateQuery

public class SqlUpdateQuery extends SqlModifyQuery implements UpdateQuery
A query that executes a SQL UPDATE statement.

This class extends SqlModifyQuery to provide functionality for executing UPDATE statements. It sets the SQL kind to SqlKind.UPDATE to indicate that this query performs an UPDATE operation.

  • Constructor Details

    • SqlUpdateQuery

      public SqlUpdateQuery()
      Constructs a new instance.

      This constructor initializes the query with SqlKind.UPDATE to indicate that it performs an UPDATE operation.

  • Method Details

    • incrementVersion

      public void incrementVersion()
      Increments the version number for the entity being updated.

      This method is called after executing the UPDATE statement to update the version number in the entity object, ensuring it matches the value in the database after the update. This is important for optimistic concurrency control.

      This implementation does nothing because this query does not support version incrementation.

      Specified by:
      incrementVersion in interface UpdateQuery