-
Notifications
You must be signed in to change notification settings - Fork 16
@BindSqlSelect
xcesco edited this page Jan 24, 2017
·
9 revisions
Allow to query a database table. When you define the query through interface's method you can define query parameter by a DAO's associated bean instance, or directly with fields.
Almost all parameters used in method can be used as query parameter.
@BindSqlSelect(where = "name=${name} and surname=${surname}")
Person selectOne(String name, @BindSqlParam("surname") String temp);
Parameters of where condition are linked to method parameters with the syntax ${<name of parameter>}
There are many return type allowed for method which define a query:
- a DAO's associated bean instance
- list of associated bean
- set of associated bean
-
Cursor: it is possible to wrap cursor with the cursor wrapper generated for bean associated to DAO. For example, given a Person and PersonDAO, will be generated
BindPersonCursor
. - It is possible to set return type as Void and define a
OnReadBeanListener
which a methodvoid onRead(E bean, int row, int rowCount)
allow to manage each row of result with only one bean (reused) instance. - It is possible to set return type as Void and define a OnReadCursorListener which a method
void onRead(Cursor cursor)
allows to manage resultset iteration with a cursor.
Given a Java class definition:
@BindType
public class Person {
public long id;
public String name;
public String surname;
public String birthCity;
public Date birthDay;
}
And a associated DAO definition:
- 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