Skip to content

Commit

Permalink
Fixed SQL bug with excluding authors, sections, sources, or types. Cl…
Browse files Browse the repository at this point in the history
…oses #251
  • Loading branch information
leifeld committed Dec 15, 2022
1 parent a2ca95a commit 197527f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dna/src/main/java/sql/Sql.java
Original file line number Diff line number Diff line change
Expand Up @@ -3016,9 +3016,9 @@ public ArrayList<Statement> getStatements(
}
String authorWhere = "AND DOCUMENTS.Author "
+ authorNot
+ "IN ("
+ "IN ('"
+ authors.stream().collect(Collectors.joining("', '"))
+ ") ";
+ "') ";
whereStatements = whereStatements + authorWhere;
whereShortText = whereShortText + authorWhere;
whereLongText = whereLongText + authorWhere;
Expand All @@ -3032,9 +3032,9 @@ public ArrayList<Statement> getStatements(
}
String sourceWhere = "AND DOCUMENTS.Source "
+ sourceNot
+ "IN ("
+ "IN ('"
+ sources.stream().collect(Collectors.joining("', '"))
+ ") ";
+ "') ";
whereStatements = whereStatements + sourceWhere;
whereShortText = whereShortText + sourceWhere;
whereLongText = whereLongText + sourceWhere;
Expand All @@ -3048,9 +3048,9 @@ public ArrayList<Statement> getStatements(
}
String sectionWhere = "AND DOCUMENTS.Section "
+ sectionNot
+ "IN ("
+ "IN ('"
+ sections.stream().collect(Collectors.joining("', '"))
+ ") ";
+ "') ";
whereStatements = whereStatements + sectionWhere;
whereShortText = whereShortText + sectionWhere;
whereLongText = whereLongText + sectionWhere;
Expand All @@ -3064,9 +3064,9 @@ public ArrayList<Statement> getStatements(
}
String typeWhere = "AND DOCUMENTS.Type "
+ typeNot
+ "IN ("
+ "IN ('"
+ types.stream().collect(Collectors.joining("', '"))
+ ") ";
+ "') ";
whereStatements = whereStatements + typeWhere;
whereShortText = whereShortText + typeWhere;
whereLongText = whereLongText + typeWhere;
Expand Down

0 comments on commit 197527f

Please sign in to comment.