@Test public void extractFromSubquery() { Seeds seeds = new SeedExtractor("SELECT (SELECT MAX(Type) FROM Product_Detail WHERE Name = 'A') Subinfo, Product FROM Products").extract(); Assert.assertTrue(seeds.getStrings().contains("A")); }
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();  }