@Test public void many() { for (int i = 0 ; i<10 ; i++) { TestModel t = new TestModel(); t.title = "title"+i; t.save(); } CursorList<TestModel> result = Query.many(TestModel.class, "select * from Tests where title like 'title%'", "title").get(); assertEquals(result.size(), 10); result.close(); }
public static <T extends QueryResult> ManyQuery<T> many(Class<T> clazz, String sql, Object... sqlArgs) { final ManyQuery<T> query = new ManyQuery<T>(); query.resultClass = clazz; query.placeholderQuery = sql; query.rawQuery = Utils.insertSqlArgs(sql, sqlArgs); return query; }
Query { public static <T extends QueryResult> ManyQuery<T> many(Class<T> clazz, String sql, Object... sqlArgs) { final ManyQuery<T> query = new ManyQuery<T>(); query.resultClass = clazz; query.placeholderQuery = sql; query.rawQuery = Utils.insertSqlArgs(sql, sqlArgs); return query; } }
Query { public static <T extends QueryResult> ManyQuery<T> many(Class<T> clazz, String sql, Object... sqlArgs) { final ManyQuery<T> query = new ManyQuery<T>(); query.resultClass = clazz; query.placeholderQuery = sql; query.rawQuery = Utils.insertSqlArgs(sql, sqlArgs); return query; } private  Query(); }
Query { public static <T extends QueryResult> ManyQuery<T> many(Class<T> clazz, String sql, Object... sqlArgs) { final ManyQuery<T> query = new ManyQuery<T>(); query.resultClass = clazz; query.placeholderQuery = sql; query.rawQuery = Utils.insertSqlArgs(sql, sqlArgs); return query; } private  Query(); static OneQuery<T> one(Class<T> clazz, String sql,
			Object... sqlArgs); static OneQuery<T> one(Class<T> clazz, int sqlResId,
                                                          Object... sqlArgs); static ManyQuery<T> many(Class<T> clazz, String sql,
			Object... sqlArgs); static ManyQuery<T> many(Class<T> clazz, int sqlResId,
                                                            Object... sqlArgs); static ManyQuery<T> all(Class<T> clazz); }
Query { public static <T extends QueryResult> ManyQuery<T> many(Class<T> clazz, String sql, Object... sqlArgs) { final ManyQuery<T> query = new ManyQuery<T>(); query.resultClass = clazz; query.placeholderQuery = sql; query.rawQuery = Utils.insertSqlArgs(sql, sqlArgs); return query; } private  Query(); static OneQuery<T> one(Class<T> clazz, String sql,
			Object... sqlArgs); static OneQuery<T> one(Class<T> clazz, int sqlResId,
                                                          Object... sqlArgs); static ManyQuery<T> many(Class<T> clazz, String sql,
			Object... sqlArgs); static ManyQuery<T> many(Class<T> clazz, int sqlResId,
                                                            Object... sqlArgs); static ManyQuery<T> all(Class<T> clazz);  }