本文整理了Java中com.j256.ormlite.dao.Dao.queryForFieldValuesArgs()
方法的一些代码示例,展示了Dao.queryForFieldValuesArgs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dao.queryForFieldValuesArgs()
方法的具体详情如下:
包路径:com.j256.ormlite.dao.Dao
类名称:Dao
方法名:queryForFieldValuesArgs
[英]Same as #queryForFieldValues(Map) but this uses SelectArg and SQL ? arguments. This is slightly more expensive but you don't have to worry about SQL quote escaping.
[中]与#queryForFieldValues(Map)相同,但它使用SelectArg和SQL?论据。这稍微贵一点,但您不必担心SQL引号转义。
代码示例来源:origin: j256/ormlite-core
/**
* @see Dao#queryForFieldValuesArgs(Map)
*/
@Override
public List<T> queryForFieldValuesArgs(Map<String, Object> fieldValues) {
try {
return dao.queryForFieldValuesArgs(fieldValues);
} catch (SQLException e) {
logMessage(e, "queryForFieldValuesArgs threw exception");
throw new RuntimeException(e);
}
}
代码示例来源:origin: com.j256.ormlite/ormlite-core
/**
* @see Dao#queryForFieldValuesArgs(Map)
*/
@Override
public List<T> queryForFieldValuesArgs(Map<String, Object> fieldValues) {
try {
return dao.queryForFieldValuesArgs(fieldValues);
} catch (SQLException e) {
logMessage(e, "queryForFieldValuesArgs threw exception");
throw new RuntimeException(e);
}
}
代码示例来源:origin: j256/ormlite-core
@Test
public void testQueryForFieldValuesArgs() throws Exception {
Dao<Foo, Integer> dao = createDao(Foo.class, true);
Map<String, Object> fieldValues = new HashMap<String, Object>();
fieldValues.put(Foo.STRING_COLUMN_NAME, "this id has a quote '");
dao.queryForFieldValuesArgs(fieldValues);
}
代码示例来源:origin: j256/ormlite-core
@Test(expected = RuntimeException.class)
public void testQueryForFieldsValuesArgsThrow() throws Exception {
@SuppressWarnings("unchecked")
Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class);
RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao);
expect(dao.queryForFieldValuesArgs(null)).andThrow(new SQLException("Testing catch"));
replay(dao);
rtDao.queryForFieldValuesArgs(null);
verify(dao);
}
内容来源于网络,如有侵权,请联系作者删除!