@Test public void one() { TestModel t = new TestModel(); t.title = "title"; t.save(); TestModel result = Query.one(TestModel.class, "select * from Tests where title=?", "title").get(); assertEquals(result.title, "title"); }
public static <T extends QueryResult> OneQuery<T> one(Class<T> clazz, String sql, Object... sqlArgs) { final OneQuery<T> query = new OneQuery<T>(); query.resultClass = clazz; query.placeholderQuery = sql; query.rawQuery = Utils.insertSqlArgs(sql, sqlArgs); return query; }
Query { public static <T extends QueryResult> OneQuery<T> one(Class<T> clazz, String sql, Object... sqlArgs) { final OneQuery<T> query = new OneQuery<T>(); query.resultClass = clazz; query.placeholderQuery = sql; query.rawQuery = Utils.insertSqlArgs(sql, sqlArgs); return query; } }
Query { public static <T extends QueryResult> OneQuery<T> one(Class<T> clazz, String sql, Object... sqlArgs) { final OneQuery<T> query = new OneQuery<T>(); query.resultClass = clazz; query.placeholderQuery = sql; query.rawQuery = Utils.insertSqlArgs(sql, sqlArgs); return query; } private  Query(); }
Query { public static <T extends QueryResult> OneQuery<T> one(Class<T> clazz, String sql, Object... sqlArgs) { final OneQuery<T> query = new OneQuery<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> OneQuery<T> one(Class<T> clazz, String sql, Object... sqlArgs) { final OneQuery<T> query = new OneQuery<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);  }