Howdy Greenhorn! Welcome to the JavaRanch!
First things first. We need to mosey on over to our JavaRanch profiles and update our name to make sure we're not makin' a mockery of ye olde
JavaRanch Naming Policy.
Now, onto your question. I think you'd be impressed if you looked at the Hibernate/JPA Criteria API. It does just that - objects are used, Java APIs do things like create restriction classes and example classes, and given an example, restriction, or other type of criteria, very complex SQL is created under the covers. It's pretty awesome, and no HQL/SQL is required.
Here's a little something I wrote on the topic of the Hibernate Criteria API:
Using the Criteria API to Perform Queries
Here's an example of the code:
And another one:
Now go deal with that darn name of yours, before the Sheriffs come a wanderin!
-Cameron McKenzie