-
Notifications
You must be signed in to change notification settings - Fork 23
Define raw query
hamsterksu edited this page Oct 23, 2014
·
1 revision
Query definition is similar to view. In the query you can use @SqlQuery annotation to write raw sql.
Query will be called in content provider and you can use parameters in the body. to define parameters use '?' symbol and provide arguments in query request
@RawQuery(LastScoreQuery.QUERY_NAME)
public static interface LastScoreQuery{
String QUERY_NAME = "last_score_query";
@URI
String CONTENT_PATH = "last_score_query";
@SqlQuery
String QUERY = "select * from " + ScoreView.VIEW_NAME + " where " + ScoreView.TABLE_SCORE + "_" + ScoreTable.IS_LAST_TOUR + " = 1";
}