Indicates an update operation.
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:
DomaNullPointerExceptionif any of the method parameters arenullOptimisticLockExceptionif optimistic locking is enabled and an update count is 0 for each entityUniqueConstraintExceptionif an unique constraint is violatedSqlFileNotFoundExceptionifsqlFileistrueand the SQL file is not foundJdbcExceptionif a JDBC related error occurs
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]The properties whose mapped columns are excluded from SQL UPDATE statements.booleanWhether SQL NULL columns are excluded from SQL INSERT statements.booleanWhether the version property is ignored.String[]The properties whose mapped columns are included in SQL UPDATE statements.booleanWhether columns mapped to unchanged properties are included in SQL UPDATE statements.intThe query timeout in seconds.booleanbooleanWhetherOptimisticLockExceptionis suppressed.
-
Element Details
-
sqlFile
boolean sqlFile- Returns:
- whether the annotated method should be mapped to an SQL file.
- Default:
- false
-
queryTimeout
int queryTimeoutThe query timeout in seconds.If not specified,
Config.getQueryTimeout()is used.- Returns:
- the query timeout
- See Also:
- Default:
- -1
-
excludeNull
boolean excludeNullWhether SQL NULL columns are excluded from SQL INSERT statements.Only if
sqlFile()isfalse, this element value is used.- Returns:
- whether SQL NULL columns are excluded
- Default:
- false
-
ignoreVersion
boolean ignoreVersionWhether the version property is ignored.If
true, the column that mapped to the version property is excluded from SQL UPDATE statements.- Returns:
- whether the version property is ignored
- Default:
- false
-
includeUnchanged
boolean includeUnchangedWhether columns mapped to unchanged properties are included in SQL UPDATE statements.Only if the method parameter type is entity class that has a
OriginalStatesannotated filed, this element value is used.- Returns:
- whether columns mapped to unchanged properties are included
- Default:
- false
-
include
String[] includeThe properties whose mapped columns are included in SQL UPDATE statements.Only if
sqlFile()isfalse, this value is used.- Returns:
- the included properties
- Default:
- {}
-
exclude
String[] excludeThe properties whose mapped columns are excluded from SQL UPDATE statements.Only if
sqlFile()isfalse, this value is used.- Returns:
- the excluded properties
- Default:
- {}
-
suppressOptimisticLockException
boolean suppressOptimisticLockExceptionWhetherOptimisticLockExceptionis suppressed.Only if
sqlFile()isfalse, this element value is used.- Returns:
- whether
OptimisticLockExceptionis suppressed
- Default:
- false
-
sqlLog
SqlLogType sqlLog- Returns:
- the output format to be used for SQL logs when this update operation is executed.
- Default:
- FORMATTED
-
returning
Returning returning- Returns:
- the
Returningannotation configuration, which defines inclusions or exclusions for returning values.
- Default:
- @org.seasar.doma.Returning
-