当前位置: 首页>>代码示例>>Java>>正文


Java ResultSetHandler类代码示例

本文整理汇总了Java中org.sql2o.ResultSetHandler的典型用法代码示例。如果您正苦于以下问题:Java ResultSetHandler类的具体用法?Java ResultSetHandler怎么用?Java ResultSetHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResultSetHandler类属于org.sql2o包,在下文中一共展示了ResultSetHandler类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPendingTasksByWorkflow

import org.sql2o.ResultSetHandler; //导入依赖的package包/类
@Override
public List<Task> getPendingTasksByWorkflow(String taskDefName, String workflowId) {
	return getWithTransaction(connection -> {

		String GET_IN_PROGRESS_TASKS_FOR_WORKFLOW =
			"SELECT json_data FROM task_in_progress tip INNER JOIN task t ON t.task_id = tip.task_id \n" +
			" WHERE task_def_name = :taskDefName AND workflow_id = :workflowId";

		ResultSetHandler<Task> resultSetHandler = resultSet -> readValue(resultSet.getString("json_data"), Task.class);

		return connection.createQuery(GET_IN_PROGRESS_TASKS_FOR_WORKFLOW)
				.addParameter("taskDefName", taskDefName)
				.addParameter("workflowId", workflowId)
				.executeAndFetch(resultSetHandler);
	});
}
 
开发者ID:Netflix,项目名称:conductor,代码行数:17,代码来源:MySQLExecutionDAO.java

示例2: getPendingTasksForTaskType

import org.sql2o.ResultSetHandler; //导入依赖的package包/类
@Override
public List<Task> getPendingTasksForTaskType(String taskName) {
	Preconditions.checkNotNull(taskName, "task name cannot be null");
	return getWithTransaction(connection -> {

		String GET_IN_PROGRESS_TASKS_FOR_TYPE =
			"SELECT json_data FROM task_in_progress tip INNER JOIN task t ON t.task_id = tip.task_id WHERE task_def_name = :taskDefName";

		ResultSetHandler<Task> resultSetHandler = resultSet -> readValue(resultSet.getString("json_data"), Task.class);

		return connection.createQuery(GET_IN_PROGRESS_TASKS_FOR_TYPE).addParameter("taskDefName", taskName).executeAndFetch(resultSetHandler);
	});
}
 
开发者ID:Netflix,项目名称:conductor,代码行数:14,代码来源:MySQLExecutionDAO.java

示例3: newResultSetHandler

import org.sql2o.ResultSetHandler; //导入依赖的package包/类
@Override
public ResultSetHandler<T> newResultSetHandler(ResultSetMetaData resultSetMetaData) throws SQLException {
    JdbcMapper<T> staticMapper = mapper.getMapper(resultSetMetaData);
    return new SfmResultSetHandler<T>(staticMapper);
}
 
开发者ID:arnaudroger,项目名称:SimpleFlatMapper,代码行数:6,代码来源:SfmResultSetHandlerFactory.java

示例4: getTasks

import org.sql2o.ResultSetHandler; //导入依赖的package包/类
private List<Task> getTasks(Connection connection, List<String> taskIds) {
	if (taskIds.isEmpty()) return Lists.newArrayList();

	String GET_TASKS_FOR_IDS = "SELECT json_data FROM task WHERE task_id IN (%s) AND json_data IS NOT NULL";
	String query = generateQueryWithParametersListPlaceholders(GET_TASKS_FOR_IDS, taskIds.size());

	ResultSetHandler<Task> resultSetHandler = resultSet -> readValue(resultSet.getString("json_data"), Task.class);

	return connection.createQuery(query).withParams(taskIds.toArray()).executeAndFetch(resultSetHandler);
}
 
开发者ID:Netflix,项目名称:conductor,代码行数:11,代码来源:MySQLExecutionDAO.java


注:本文中的org.sql2o.ResultSetHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。