@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Update
The annotated method must be a member of a Dao annotated interface.
@Entity
public class Employee {
...
}
@Dao
public interface EmployeeDao {
@Update
int update(Employee employee);
}
The method may throw following exceptions:
DomaNullPointerException if any of the method parameters are null
OptimisticLockException if optimistic locking is enabled and an update count is 0
for each entity
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 |
|---|---|
java.lang.String[] |
exclude
The properties whose mapped columns are excluded from SQL UPDATE statements.
|
boolean |
excludeNull
Whether SQL NULL columns are excluded from SQL INSERT statements.
|
boolean |
ignoreVersion
Whether the version property is ignored.
|
java.lang.String[] |
include
The properties whose mapped columns are included in SQL UPDATE statements.
|
boolean |
includeUnchanged
Whether columns mapped to unchanged properties are included in SQL UPDATE statements.
|
int |
queryTimeout
The query timeout in seconds.
|
boolean |
sqlFile |
SqlLogType |
sqlLog |
boolean |
suppressOptimisticLockException
Whether
OptimisticLockException is suppressed. |
public abstract boolean sqlFile
public abstract int queryTimeout
If not specified, Config.getQueryTimeout() is used.
Statement.setQueryTimeout(int)public abstract boolean excludeNull
Only if sqlFile() is false, this element value is used.
public abstract boolean ignoreVersion
If true, the column that mapped to the version property is excluded from SQL UPDATE
statements.
public abstract boolean includeUnchanged
Only if the method parameter type is entity class that has a OriginalStates
annotated filed, this element value is used.
public abstract java.lang.String[] include
Only if sqlFile() is false, this value is used.
public abstract java.lang.String[] exclude
Only if sqlFile() is false, this value is used.
public abstract boolean suppressOptimisticLockException
OptimisticLockException is suppressed.
Only if sqlFile() is false, this element value is used.
OptimisticLockException is suppressedpublic abstract SqlLogType sqlLog