@Test public void stripComments2() { String sql = "insert into test_table values(1, 'hello');\n" + "insert into test_table values(2, 'hello');\n" + "--insert into test_table values(3, 'hello');\n" + "insert into test_table values(4, 'hello');"; String[] result = StringUtils.processMutliLineSQL(sql, true, true, ";"); assertEquals(3, result.length); }
public static String[] processMutliLineSQL(String multiLineSQL,boolean stripComments, boolean splitStatements, String endDelimiter) { String stripped = stripComments ? stripComments(multiLineSQL) : multiLineSQL; if (splitStatements) { return splitSQL(stripped, endDelimiter); } else { return new String[]{stripped}; } }
StringUtils { public static String[] processMutliLineSQL(String multiLineSQL,boolean stripComments, boolean splitStatements, String endDelimiter) { String stripped = stripComments ? stripComments(multiLineSQL) : multiLineSQL; if (splitStatements) { return splitSQL(stripped, endDelimiter); } else { return new String[]{stripped}; } } }
StringUtils { public static String[] processMutliLineSQL(String multiLineSQL,boolean stripComments, boolean splitStatements, String endDelimiter) { String stripped = stripComments ? stripComments(multiLineSQL) : multiLineSQL; if (splitStatements) { return splitSQL(stripped, endDelimiter); } else { return new String[]{stripped}; } }  }
StringUtils { public static String[] processMutliLineSQL(String multiLineSQL,boolean stripComments, boolean splitStatements, String endDelimiter) { String stripped = stripComments ? stripComments(multiLineSQL) : multiLineSQL; if (splitStatements) { return splitSQL(stripped, endDelimiter); } else { return new String[]{stripped}; } }  static String trimToEmpty(String string); static String trimToNull(String string); static String[] processMutliLineSQL(String multiLineSQL,boolean stripComments, boolean splitStatements, String endDelimiter); static String[] splitSQL(String multiLineSQL, String endDelimiter); static String stripComments(String multiLineSQL); static String join(String[] array, String delimiter); static String join(Collection<String> collection, String delimiter); static List<String> splitAndTrim(String s, String regex); static String repeat(String string, int times); static String join(Integer[] array, String delimiter); static String join(int[] array, String delimiter); }
StringUtils { public static String[] processMutliLineSQL(String multiLineSQL,boolean stripComments, boolean splitStatements, String endDelimiter) { String stripped = stripComments ? stripComments(multiLineSQL) : multiLineSQL; if (splitStatements) { return splitSQL(stripped, endDelimiter); } else { return new String[]{stripped}; } }  static String trimToEmpty(String string); static String trimToNull(String string); static String[] processMutliLineSQL(String multiLineSQL,boolean stripComments, boolean splitStatements, String endDelimiter); static String[] splitSQL(String multiLineSQL, String endDelimiter); static String stripComments(String multiLineSQL); static String join(String[] array, String delimiter); static String join(Collection<String> collection, String delimiter); static List<String> splitAndTrim(String s, String regex); static String repeat(String string, int times); static String join(Integer[] array, String delimiter); static String join(int[] array, String delimiter);  }