@Test public void testCanonicalizeString() { List<String> testQuery = ImmutableList.of( "insert foo into bar ; ", "insert\nfoo into bar", "insert\n \tfoo into bar", "insert foo into bar;", "insert foo into bar; ", "insert foo into bar; ;; ", "\tinsert foo into bar;", "\t insert foo into bar;", "insert foo into bar;\n;; ", " insert \t\nfoo \n \tinto \n\rbar\n\t; ", " insert foo into bar;", " insert foo into bar", " insert foo into bar "); String canonicalQuery = "insert foo into bar"; testQuery.forEach(sql -> assertEquals(canonicalQuery, SQLString.canonicalizeString(sql))); }
public static String canonicalizeString(String sql) { return canonicalizeString(sql, false); }
SQLString extends BasicSQLString { public static String canonicalizeString(String sql) { return canonicalizeString(sql, false); } }
SQLString extends BasicSQLString { public static String canonicalizeString(String sql) { return canonicalizeString(sql, false); } private  SQLString(String sql); protected  SQLString(String key, String sql, DBType dbType); }
SQLString extends BasicSQLString { public static String canonicalizeString(String sql) { return canonicalizeString(sql, false); } private  SQLString(String sql); protected  SQLString(String key, String sql, DBType dbType); static RegisteredSQLString registerQuery(String key, String sql); static void registerQuery(String key, String sql, DBType... dbTypes); static RegisteredSQLString registerQuery(String key, String sql, DBType dbType); static boolean isQueryRegistered(String key); static boolean isValidKey(final String key); static String canonicalizeString(String sql); static void registerQueryVariants(String baseKey,
                                             Map<Set<String>, String> map, String sqlFormat,
                                             DBType type, List<SqlClause> clauses); static RegisteredSQLString getRegisteredQueryByKey(FinalSQLString key); }
SQLString extends BasicSQLString { public static String canonicalizeString(String sql) { return canonicalizeString(sql, false); } private  SQLString(String sql); protected  SQLString(String key, String sql, DBType dbType); static RegisteredSQLString registerQuery(String key, String sql); static void registerQuery(String key, String sql, DBType... dbTypes); static RegisteredSQLString registerQuery(String key, String sql, DBType dbType); static boolean isQueryRegistered(String key); static boolean isValidKey(final String key); static String canonicalizeString(String sql); static void registerQueryVariants(String baseKey,
                                             Map<Set<String>, String> map, String sqlFormat,
                                             DBType type, List<SqlClause> clauses); static RegisteredSQLString getRegisteredQueryByKey(FinalSQLString key);  }