java.lang.Object
org.seasar.doma.jdbc.query.AbstractQuery
org.seasar.doma.jdbc.query.SqlModifyQuery
org.seasar.doma.jdbc.query.SqlInsertQuery
- All Implemented Interfaces:
InsertQuery,ModifyQuery,Query
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.
-
Field Summary
Fields inherited from class org.seasar.doma.jdbc.query.SqlModifyQuery
kind, optimisticLockCheckRequired, parameters, sql, sqlLogType, sqlNodeFields inherited from class org.seasar.doma.jdbc.query.AbstractQuery
callerClassName, callerMethodName, config, message, method, queryTimeout -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateId(Statement statement) Generates an ID for the inserted row.Methods inherited from class org.seasar.doma.jdbc.query.SqlModifyQuery
addParameter, clearParameters, complete, getSql, getSqlExecutionSkipCause, getSqlLogType, isAutoGeneratedKeysSupported, isExecutable, isOptimisticLockCheckRequired, prepare, prepareOptions, prepareSql, setSqlLogType, setSqlNode, toStringMethods inherited from class org.seasar.doma.jdbc.query.AbstractQuery
comment, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout, setCallerClassName, setCallerMethodName, setConfig, setMessage, setMethod, setQueryTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.seasar.doma.jdbc.query.ModifyQuery
getSql, getSqlExecutionSkipCause, getSqlLogType, isAutoGeneratedKeysSupported, isExecutable, isOptimisticLockCheckRequiredMethods inherited from interface org.seasar.doma.jdbc.query.Query
comment, complete, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout, prepare
-
Constructor Details
-
SqlInsertQuery
public SqlInsertQuery()Constructs a new instance.This constructor initializes the query with
SqlKind.INSERTto indicate that it performs an INSERT operation.
-
-
Method Details
-
generateId
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:
generateIdin interfaceInsertQuery- Parameters:
statement- the statement used for the INSERT operation
-