@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface BatchInsert
The annotated method must be a member of a Dao annotated interface.
@Entity
public class Employee {
...
}
@Dao
public interface EmployeeDao {
@BatchInsert
int[] insert(List<Employee> employee);
}
The method may throw following exceptions:
DomaNullPointerException if any of the method parameters are null
UniqueConstraintException if an unique constraint is violated
SqlFileNotFoundException if sqlFile is true and the SQL file is not
found
JdbcException if a JDBC related error occurs
| Modifier and Type | Optional Element and Description |
|---|---|
int |
batchSize
The batch size.
|
DuplicateKeyType |
duplicateKeyType
This variable represents the type of duplicate key handling strategy for an insert operation.
|
java.lang.String[] |
exclude
The properties whose mapped columns are excluded from SQL INSERT statements.
|
boolean |
ignoreGeneratedKeys
Whether auto-generated keys are not retrieved from the database to improve performance.
|
java.lang.String[] |
include
The properties whose mapped columns are included in SQL INSERT statements.
|
int |
queryTimeout
The query timeout in seconds.
|
boolean |
sqlFile |
SqlLogType |
sqlLog |
public abstract boolean sqlFile
public abstract int queryTimeout
If not specified, Config.getQueryTimeout() is used.
Statement.setQueryTimeout(int)public abstract int batchSize
If not specified, Config.getBatchSize() is used.
This value is used when Statement.executeBatch() is executed.
PreparedStatement.addBatch()public abstract java.lang.String[] include
Only if sqlFile() is false, this value is available.
public abstract java.lang.String[] exclude
Only if sqlFile() is false, this value is available.
public abstract SqlLogType sqlLog
public abstract boolean ignoreGeneratedKeys
public abstract DuplicateKeyType duplicateKeyType