Over the last few years (when I have started dealing more and more with Databases and/or Tables) a common problem has surfaced over and over again. How to represent the selection criteria from a table. In two of the situations the team was using TopLink, and wanted a neutral way to accomplish what the TopLink Expression/ExpressionBuilder did. In all the cases, the teams eventually created an internal/proprietary approach to the Row Selection Criteria (most of which were applied to generate SQL WHERE clauses.
This code is my attempt to provide a solution (that will NOT need to be recreated again and again).
Note: While this is titled "SQL WHERE Clause", and the code is designed to easily produce a valid SQL WHERE clause, there is nothing that says that the resulting WhereClause tree can not be used to select rows from anything else (like a simple in-memory List).
Download options (vs 1.03) (as .zip):
JUnit used.Individual Source Files:
SimpleTableIdentifier
SimpleColumnDefinition
WhereClauseNotable
WhereClauseColumnSupport
AbstractColumnDefinition
AbstractWhereClauseAssociativeList
AbstractWhereClauseColumnAndLikeValue
AbstractWhereClauseColumnAndTwoValues
AbstractWhereClauseColumnAndValue
AbstractWhereClauseColumnIsIn
AbstractWhereClauseColumnReference
AbstractWhereClauseWrapper