Hi Tia,
I don't have more complex examples, like using multiple tables in a single (join) statement.
However, you should be able to use joins just as easily as you would use a simple SQL select statetement. Just keep in mind the following:
1) Stick to the SQLite3 syntax (see
http://sqlite.org/lang.html and specifically,
http://sqlite.org/lang_select.html)
2) Query the GenericRow result object (or create your own class) mapped to the result-columns of the SELECT statement.
e.g. (untested):
@Select("SELECT
user.name as name, user.email as email, order.amount as amount FROM user INNER JOIN order ON
user.id = order.userId")
void getOrderAmounts(ListCallback<GenericRow> result);
would imply the following call:
service.getOrderAmounts(new ListCallback<GenericRow>() {
public boolean onFailure(SQLError e) {
return true;
}
public void onSuccess(List<GenericRow> result) {
for (GenericRow row : result) {
// Available attributes:
// row.getString("name")
// row.getString("email")
// row.getDouble("amount")
}
}
});
or something like that :-)
Is this example what you're looking for?
Cheers,
Bart Guijt
E:
bgu...@gmail.com
T:
+31 6 30408987