I have some legacy SQL and I want to split it up into it's constituent parts & then add more criteria, an order by clause, etc.
Are there any existing Java libraries out there that interpret SQL like this?
So I want to do something like
deconstructedSQL.getCriteria().add("price > 100");
or
deconstructedSQL.getOrderBy().add("price");
or
String select = deconstructedSQL.getSelect();
if ("*".equals(select))
{
deconstructedSQL.setSelect("my_table.*");
}
I can use Dialects from Hibernate to add info specific to my database for paging (setFirstResult
& setMaxResult
), but I'd like to take it a step further.