- All Implemented Interfaces:
BatchInsertQuery,BatchModifyQuery,Query
This class extends SqlBatchModifyQuery to provide functionality for executing batch
INSERT statements. It initializes the SQL kind to SqlKind.INSERT to indicate that this
query performs INSERT operations.
-
Field Summary
Fields inherited from class org.seasar.doma.jdbc.query.SqlBatchModifyQuery
batchSize, kind, optimisticLockCheckRequired, parameters, parameterSize, sqlLogType, sqlNode, sqlsFields 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, int index) Generates an ID for a single inserted row in the batch.booleanDetermines if batch operations are supported for this query.Methods inherited from class org.seasar.doma.jdbc.query.SqlBatchModifyQuery
addParameter, clearParameters, complete, getBatchSize, getSql, getSqlExecutionSkipCause, getSqlLogType, getSqls, isAutoGeneratedKeysSupported, isExecutable, isOptimisticLockCheckRequired, prepare, prepareOptions, prepareSql, setBatchSize, 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.BatchInsertQuery
generateIdsMethods inherited from interface org.seasar.doma.jdbc.query.BatchModifyQuery
getBatchSize, getSql, getSqlExecutionSkipCause, getSqlLogType, getSqls, isAutoGeneratedKeysSupported, isExecutable, isOptimisticLockCheckRequiredMethods inherited from interface org.seasar.doma.jdbc.query.Query
comment, complete, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout, prepare
-
Constructor Details
-
SqlBatchInsertQuery
public SqlBatchInsertQuery()Constructs a new instance.This constructor initializes the query with
SqlKind.INSERTto indicate that it performs INSERT operations.
-
-
Method Details
-
generateId
Generates an ID for a single inserted row in the batch.This method is called after executing the batch to generate IDs for rows that use auto-generated keys or sequences.
This implementation does nothing because this query does not support auto-generated keys.
- Specified by:
generateIdin interfaceBatchInsertQuery- Parameters:
statement- the statement used for the batch operationindex- the index of the element in the batch
-
isBatchSupported
public boolean isBatchSupported()Determines if batch operations are supported for this query.Some database operations or configurations may not support batch processing. This method allows implementations to indicate whether batch operations can be used.
This implementation always returns true because SQL batch queries are always supported.
- Specified by:
isBatchSupportedin interfaceBatchInsertQuery- Returns:
- true if batch operations are supported, false otherwise
-