I’m looking for a SQL query builder that can optimize SQL queries based on a set of data that I want to retrieve from the database. The set of data is an array of “give me the value of column A from table B where the column C equals D”. The value of A, B, C and D can be arbitrary in the array, but many records will share the same B, C and D.
What would be the best way to concatenate a query for Hibernate? Is there any reason to use another framework for queries like this?
Criteria is for you:
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/querycriteria.html