@Retention(value=RUNTIME) @Target(value=METHOD) public @interface BindSqlSelect
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:
Person and
PersonDAO, will be generated BindPersonCursorOnReadBeanListener which a method
void onRead(E bean, int row, int rowCount) allow to manage each
row of result with only one bean (reused) instance.OnReadCursorListener which a method
void onRead(Cursor cursor) allows to manage resultset iteration
with a cursor.| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
distinct
if true, set distinct clause
|
String[] |
excludedFields
properties to exclude from SELECT statement.
|
String |
groupBy
having statement
|
String |
having
having statement
|
String |
orderBy
order statement
|
int |
pageSize
Allow to define limit for query result.
|
String[] |
value
properties to include into SELECT command
|
String |
where
where condition
|
public abstract boolean distinct
public abstract String[] value
public abstract String[] excludedFields
public abstract String where
public abstract String having
public abstract String groupBy
public abstract String orderBy
Copyright © 2017. All rights reserved.