private static List<Project> selectProjects(DbSession session, @Nullable String projectUuid) { List<Project> projects = new ArrayList<>(); try (PreparedStatement stmt = createProjectsStatement(session, projectUuid); ResultSet rs = stmt.executeQuery()) { while (rs.next()) { String orgUuid = rs.getString(1); String uuid = rs.getString(2); String key = rs.getString(3); String name = rs.getString(4); Long analysisDate = DatabaseUtils.getLong(rs, 5); List<String> tags = readDbTags(DatabaseUtils.getString(rs, 6)); Project project = new Project(orgUuid, uuid, key, name, tags, analysisDate); projects.add(project); } return projects; } catch (SQLException e) { throw new IllegalStateException("Fail to execute request to select all projects", e); } }
doc.setSeverity(rs.getString(5)); doc.setStatus(rs.getString(6)); doc.setEffort(getLong(rs, 7)); doc.setAuthorLogin(rs.getString(8)); doc.setFuncCloseDate(longToDate(getLong(rs, 9))); doc.setFuncCreationDate(longToDate(getLong(rs, 10))); doc.setFuncUpdateDate(longToDate(getLong(rs, 11))); Integer ruleId = rs.getInt(12); doc.setRuleId(ruleId);
private static List<Project> selectProjects(DbSession session, long afterDate, @Nullable String projectUuid) { List<Project> projects = new ArrayList<>(); try (PreparedStatement stmt = createProjectsStatement(session, afterDate, projectUuid); ResultSet rs = stmt.executeQuery()) { while (rs.next()) { String orgUuid = rs.getString(1); String uuid = rs.getString(2); String key = rs.getString(3); String name = rs.getString(4); String analysisUuid = DatabaseUtils.getString(rs, 5); Long analysisDate = DatabaseUtils.getLong(rs, 6); Project project = new Project(orgUuid, uuid, key, name, analysisUuid, analysisDate); projects.add(project); } return projects; } catch (SQLException e) { throw new IllegalStateException("Fail to execute request to select all projects", e); } }
doc.setSeverity(rs.getString(5)); doc.setStatus(rs.getString(6)); doc.setEffort(getLong(rs, 7)); doc.setAuthorLogin(rs.getString(8)); doc.setFuncCloseDate(longToDate(getLong(rs, 9))); doc.setFuncCreationDate(longToDate(getLong(rs, 10))); doc.setFuncUpdateDate(longToDate(getLong(rs, 11))); Integer ruleId = rs.getInt(12); doc.setRuleId(ruleId);