protected Map<String, Integer> listUpstreamPipelinesBasedOnMavenDependencies(@Nonnull String downstreamJobFullName, int downstreamBuildNumber) {
        LOGGER.log(Level.FINER, "listUpstreamPipelinesBasedOnMavenDependencies({0}, {1})", new Object[]{downstreamJobFullName, downstreamBuildNumber});

        String sql = "select  upstream_job.full_name, upstream_build.number\n" +
                "from JENKINS_JOB as upstream_job\n" +
                "inner join JENKINS_BUILD as upstream_build on (upstream_job.id = upstream_build.job_id and upstream_job.last_successful_build_number = upstream_build.number)\n" +
                "inner join GENERATED_MAVEN_ARTIFACT on (upstream_build.id = GENERATED_MAVEN_ARTIFACT.build_id  and GENERATED_MAVEN_ARTIFACT.skip_downstream_triggers = false)\n" +
                "inner join MAVEN_ARTIFACT on GENERATED_MAVEN_ARTIFACT.artifact_id = MAVEN_ARTIFACT.id\n" +
                "inner join MAVEN_DEPENDENCY on (MAVEN_DEPENDENCY.artifact_id = MAVEN_ARTIFACT.id and MAVEN_DEPENDENCY.ignore_upstream_triggers = false)\n" +
                "inner join JENKINS_BUILD as downstream_build on MAVEN_DEPENDENCY.build_id = downstream_build.id\n" +
                "inner join JENKINS_JOB as downstream_job on downstream_build.job_id = downstream_job.id\n" +
                "where downstream_job.full_name = ? and downstream_job.jenkins_master_id = ? and  downstream_build.number = ? and upstream_job.jenkins_master_id = ?";

        Map<String, Integer> upstreamJobsFullNames = new HashMap<>();
        LOGGER.log(Level.FINER, "sql: {0}, jobFullName:{1}, buildNumber: {2}", new Object[]{sql, downstreamJobFullName, downstreamBuildNumber});

        try (Connection cnn = ds.getConnection()) {
            try (PreparedStatement stmt = cnn.prepareStatement(sql)) {
                stmt.setString(1, downstreamJobFullName);
                stmt.setLong(2, getJenkinsMasterPrimaryKey(cnn));
                stmt.setInt(3, downstreamBuildNumber);
                stmt.setLong(4, getJenkinsMasterPrimaryKey(cnn));
                try (ResultSet rst = stmt.executeQuery()) {
                    while (rst.next()) {
                        upstreamJobsFullNames.put(rst.getString(1), rst.getInt(2));
                    }
                }
            }
        } catch (SQLException e) {
            throw new RuntimeSqlException(e);
        }
        LOGGER.log(Level.FINE, "listUpstreamPipelinesBasedOnMavenDependencies({0}, {1}): {2}", new Object[]{downstreamJobFullName, downstreamBuildNumber, upstreamJobsFullNames});

        return upstreamJobsFullNames;
    }
protected Map < String , Integer > listUpstreamPipelinesBasedOnMavenDependencies ( @ Nonnull String downstreamJobFullName , int downstreamBuildNumber ) { LOGGER . log ( Level . FINER , "listUpstreamPipelinesBasedOnMavenDependencies({0}, {1})" , new Object [ ] { downstreamJobFullName , downstreamBuildNumber } ) ; String sql = "select  upstream_job.full_name, upstream_build.number\n" + "from JENKINS_JOB as upstream_job\n" + "inner join JENKINS_BUILD as upstream_build on (upstream_job.id = upstream_build.job_id and upstream_job.last_successful_build_number = upstream_build.number)\n" + "inner join GENERATED_MAVEN_ARTIFACT on (upstream_build.id = GENERATED_MAVEN_ARTIFACT.build_id  and GENERATED_MAVEN_ARTIFACT.skip_downstream_triggers = false)\n" + "inner join MAVEN_ARTIFACT on GENERATED_MAVEN_ARTIFACT.artifact_id = MAVEN_ARTIFACT.id\n" + "inner join MAVEN_DEPENDENCY on (MAVEN_DEPENDENCY.artifact_id = MAVEN_ARTIFACT.id and MAVEN_DEPENDENCY.ignore_upstream_triggers = false)\n" + "inner join JENKINS_BUILD as downstream_build on MAVEN_DEPENDENCY.build_id = downstream_build.id\n" + "inner join JENKINS_JOB as downstream_job on downstream_build.job_id = downstream_job.id\n" + "where downstream_job.full_name = ? and downstream_job.jenkins_master_id = ? and  downstream_build.number = ? and upstream_job.jenkins_master_id = ?" ; Map < String , Integer > upstreamJobsFullNames = new HashMap < > ( ) ; LOGGER . log ( Level . FINER , "sql: {0}, jobFullName:{1}, buildNumber: {2}" , new Object [ ] { sql , downstreamJobFullName , downstreamBuildNumber } ) ; try ( Connection cnn = ds . getConnection ( ) ) { try ( PreparedStatement stmt = cnn . prepareStatement ( sql ) ) { stmt . setString ( 1 , downstreamJobFullName ) ; stmt . setLong ( 2 , getJenkinsMasterPrimaryKey ( cnn ) ) ; stmt . setInt ( 3 , downstreamBuildNumber ) ; stmt . setLong ( 4 , getJenkinsMasterPrimaryKey ( cnn ) ) ; try ( ResultSet rst = stmt . executeQuery ( ) ) { while ( rst . next ( ) ) { upstreamJobsFullNames . put ( rst . getString ( 1 ) , rst . getInt ( 2 ) ) ; } } } } catch ( SQLException e ) { throw new RuntimeSqlException ( e ) ; } LOGGER . log ( Level . FINE , "listUpstreamPipelinesBasedOnMavenDependencies({0}, {1}): {2}" , new Object [ ] { downstreamJobFullName , downstreamBuildNumber , upstreamJobsFullNames } ) ; return upstreamJobsFullNames ; }
@param downstreamJobFullName
@param downstreamBuildNumber
@return