Class SqlInsertQuery

All Implemented Interfaces:
InsertQuery, ModifyQuery, Query

public class SqlInsertQuery extends SqlModifyQuery implements InsertQuery
A query that executes a SQL INSERT statement.

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

  • Constructor Details

    • SqlInsertQuery

      public SqlInsertQuery()
      Constructs a new instance.

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

  • Method Details

    • generateId

      public void generateId(Statement statement)
      Generates an ID for the inserted row.

      This method is called after executing the INSERT statement to retrieve and set auto-generated keys or sequence values for the entity. It's typically used for primary key generation strategies like identity columns or sequences.

      This implementation does nothing because this query does not support auto-generated keys.

      Specified by:
      generateId in interface InsertQuery
      Parameters:
      statement - the statement used for the INSERT operation