File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/test/java/org/javawebstack/orm/test/shared/util Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1111import static org .javawebstack .orm .test .shared .knowledge .QueryKnowledgeBase .TOP_LEVEL_SELECT_KEYWORDS ;
1212import static org .junit .jupiter .api .Assertions .fail ;
1313
14+ /**
15+ * The QueryStringUtil class wraps a normal string which is assumed, but not verified, to be an SQL query and provides
16+ * various utility functions for tests purposes on them.
17+ */
1418public class QueryStringUtil {
1519
1620 String queryString ;
@@ -20,6 +24,13 @@ public QueryStringUtil(String queryString) {
2024 }
2125
2226
27+ /**
28+ * Retrieves all sections of the query prefaced by the given top level keyword. Does not include the keyword and
29+ * is delimited by the next top level keyword occurrence if it exists.
30+ * @param topLevelKeyword The top level SQL select query keyword to look for.
31+ * @return A list of strings containing only the inner part of the query. It will include additional spaces if the
32+ * query had more than one space.
33+ */
2334 public List <String > getTopLevelSectionsByKeyword (String topLevelKeyword ) {
2435 String capitalizedKeyword = topLevelKeyword .toUpperCase (Locale .ROOT );
2536 String queryString = this .queryString ;
You can’t perform that action at this time.
0 commit comments