Transactional class
Annotation for define transaction on database. For define transaction you have to use other dao methods name as sequentialActions and pass required parameters by InsertParam, UpdateParam, DeleteParam and QueryParam annotations. The return type of these methods must be Future
@Dao()
abstract class NoteDao {
@Insert(onConflict: OnConflictStrategy.ignore)
Future<void> insert(Note note);
@Query("delete from Note where id = :id")
Future<void> deleteById(int id);
@Transactional(sequentialActions: ['insert', 'deleteById'])
Future<void> insertAndDeleteById(
@InsertParam() Note newNote,
@QueryParam('deleteById', 'id') int noteId,
);
}
Constructors
-
Transactional({required List<
String> sequentialActions}) -
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sequentialActions
→ List<
String> -
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- fields ↔ _TransactionalFields
-
getter/setter pair