-
Notifications
You must be signed in to change notification settings - Fork 16
@BindSqlTransaction
xcesco edited this page May 22, 2019
·
3 revisions
It's the annotation used in a DataSource interface to create static methods that define a set of operations that need to be managed as a single operation. A method annotated with this annotation can accept Daos that are used in the transaction and the external parameters. This kind of method has to return void. Given the following data source definition:
@BindDataSource(fileName="app.db", version=1, daoSet={DaoPerson.class})
public interface AppDataSource {
@BindSqlTransaction
static void execute(DaoPerson daoPerson, String name) {
daoPerson.insert(new Person(-1, name, "Surname"));
}
}
For the method execute
will be generated the method executeAsync
(original name + Async
suffix). The Dao parameters will be removed. In the generated data source you can call the following method:
BindAppDataSource ds = BindAppDataSource.getInstance();
Future<Boolean> result = ds.executeAsync("tonj");
The generated code will execute the transaction in another thread.
- Introduction
- Goals & Features
- Kotlin
- Immutable or Mutable Pojo
- Annotation Processor Args
- Credits
- Articles
- Benchmarks
- Setup
- Tutorial
- Usage
- Dependencies and inspirations
- Stackoverflow
- Documentation
- SQL logging
- Data source options
- Indices
- SQL Type adapter
- Global SQL Type adapter
- Constraints
- Live data: welcome Architectural components!!
- Paged Live data
- Dynamic parts
- Transactional and batch operations
- Async Transactional and batch operations
- Global transaction
- Support for immutable POJO
- Generate Content provider
- Generate Database schema generation
- Database migration
- BindSqlColumn
- BindContentProvider
- BindContentProviderEntry
- BindContentProviderPath
- BindDao
- BindDaoMany2Many
- BindDataSource
- BindDataSourceOptions
- BindDataSourceUpdateTask
- BindIndex
- BindSqlRelation
- BindSqlAdapter
- BindSqlChildSelect
- BindSqlDelete
- BindSqlDynamicOrderBy
- BindSqlDynamicWhere
- BindSqlDynamicWhereParams
- BindSqlInsert
- BindSqlPageSize
- BindSqlParam
- BindSqlSelect
- BindSqlUpdate
- BindSqlType
- BindSqlTransaction