Parsing search queries in Java
java, search
Solution
SQL-ORM is a very lightweight Java library which includes the ability to construct a (dynamic) SQL query in Java as a graph of objects
IMHO, this is a far better technique for building dynamic SQL queries than the usual String concatentation method.
Disclaimer: I have made some very minor contributions to this project
Problem
I have been trying to find an easy way to parse a search query and convert it to an SQL query for my DB. I have found two solutions: - Lucene: Powerful Java-based search engine, contains a query parser but it isn't very configurable and I could find a way to easily hack/adapt it to create SQL queries. - ANTLR: A veteran text lexer-parser. Used for building anything from compilers to sky scrapers. ANTLR is highly configurable but everyone touching the code from now on will have to learn a new language... Any other ideas?