Skip to content

Commit

Permalink
Merge branch 'dev' into feature/DT-55-persist-pattern-names
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-cline committed Oct 3, 2023
2 parents e648c38 + 80a968c commit 1a96682
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.12.261</version>
<version>1.11.18</version>
</dependency>
<!-- Very efficient collections of primitive data types for Java. -->
<dependency>
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/com/conveyal/gtfs/loader/JdbcTableWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,11 @@ private String[] parseExceptionListField(int id, String namespace, Table table,
return parsedString.replaceAll("[{}]", "").split("[,]", 0);
}

private String getResultSetString(int column, ResultSet resultSet) throws java.sql.SQLException {
String resultSetString = resultSet.getString(column);
return resultSetString == null ? "" : resultSetString;
}

/**
* Delete all entries in calendar dates associated with a schedule exception.
*/
Expand Down Expand Up @@ -1579,7 +1584,7 @@ private void updateReferencingTables(
connection.rollback();
if (entityClass.getSimpleName().equals("Stop")) {
String patternStopLookup = String.format(
"select distinct p.id, r.id " +
"select distinct p.id, r.id, r.route_short_name, r.route_id " +
"from %s.pattern_stops ps " +
"inner join " +
"%s.patterns p " +
Expand All @@ -1599,7 +1604,12 @@ private void updateReferencingTables(
ResultSet resultSet = patternStopSelectStatement.getResultSet();
while (resultSet.next()) {
patternAndRouteIds.add(
"{" + resultSet.getString(1) + "-" + resultSet.getString(2) + "}"
String.format("{%s-%s-%s-%s}",
getResultSetString(1, resultSet),
getResultSetString(2, resultSet),
getResultSetString(3, resultSet),
getResultSetString(4, resultSet)
)
);
}
}
Expand Down

0 comments on commit 1a96682

Please sign in to comment.