@Test public void extractSubQueries() { Seeds seeds = new SeedExtractor("select * from table where name = (select name from t2 where name = 'mauricio') and age = 10").extract(); Assert.assertTrue(seeds.getStrings().contains("mauricio")); Assert.assertTrue(seeds.getLongs().contains("10")); }
public Seeds extract() { Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(sql); } catch (JSQLParserException e) { throw new RuntimeException(e); } Seeds seeds = new Seeds(); stmt.getSelectBody().accept(new SeedVisitor(seeds)); return seeds; }
SeedExtractor { public Seeds extract() { Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(sql); } catch (JSQLParserException e) { throw new RuntimeException(e); } Seeds seeds = new Seeds(); stmt.getSelectBody().accept(new SeedVisitor(seeds)); return seeds; } }
SeedExtractor { public Seeds extract() { Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(sql); } catch (JSQLParserException e) { throw new RuntimeException(e); } Seeds seeds = new Seeds(); stmt.getSelectBody().accept(new SeedVisitor(seeds)); return seeds; } SeedExtractor(String sql); }
SeedExtractor { public Seeds extract() { Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(sql); } catch (JSQLParserException e) { throw new RuntimeException(e); } Seeds seeds = new Seeds(); stmt.getSelectBody().accept(new SeedVisitor(seeds)); return seeds; } SeedExtractor(String sql); Seeds extract(); }
SeedExtractor { public Seeds extract() { Select stmt = null; try { stmt = (Select) CCJSqlParserUtil.parse(sql); } catch (JSQLParserException e) { throw new RuntimeException(e); } Seeds seeds = new Seeds(); stmt.getSelectBody().accept(new SeedVisitor(seeds)); return seeds; } SeedExtractor(String sql); Seeds extract();  }