-
Notifications
You must be signed in to change notification settings - Fork 24
Define view
hamsterksu edited this page Oct 23, 2014
·
1 revision
View is useful mechanism to aggregate data. You can use @Join, @RawJoin to join tables. The library support all join types: INNER, LEFT, RIGHT, CROSS
You can define selected columns from each tables if you want. Use @Columns or @IgnoreColumns to limit selected columns.
@SimpleView(ResultView.VIEW_NAME)
public static interface ResultView {
@URI(type = URI.Type.DIR, onlyQuery = true)
String URI_CONTENT = "result_view";
String VIEW_NAME = "result_view";
@From(ResultsTable.TABLE_NAME)
String TABLE_RESULT = "result_t";
@Join(joinTable = TeamTable.TABLE_NAME, joinColumn = TeamTable.ID, onTableAlias = TABLE_RESULT, onColumn = ResultsTable.TEAM_ID)
String TABLE_TEAM = "team_t";
}