Specifically, I'm not exactly planning on a Query-by-Example API, but rather a dynamic SQL statement builder API (also insert, update, delete, etc.). I run into this problem all the time where the user is specifying what they'd like to search for, and so you need to build a SQL statement on-the-fly.
Yes, dynamic SQL/OQL generation is exactly what I am talking about. Perhaps I chose Query-By-Example terminology poorly in that it's not QBE itself but rather the API that enables QBE-type functionality.
If you're curious, take a look at the DynamicSqlSelectStatment interface.
I looked at your code (DynamicSqlSelectStatement) and it looks very much like something I had built (I call it QueryBuilder). Do you plan support for functions, GROUP BY and ORDER BY clauses? You might have that in the rest of your API as I didn't look thoroughly.
Actually the original version I did for my old firm for v1.0 was called QueryBuilder. Then when I was exposed to HQL I renamed it SqlQueryBuilder and introduced an HqlQueryBuilder. We're definitely thinking along the same lines :) I've never implemented a GROUP BY clause before, but I certainly think it's valuable.
Let me know if you have any comments, questions, etc!
So, are you planning a persistence (O/R mapping) layer like Apache ObjectBridge and Hibernate or an abstraction API like Mapper?
Actually, I'm planning on using Morph (morph.sourceforge.net) to provide the functionality that Mapper does. I was planning on having this wait until Morph 1.1, but so you can see what I'm talking about I'll try to get it out the door this weekend. The nice thing with using Morph will be if you have a ResultSet like this
StartDate (String), EndDate (String), MyNumber (Number)
that needs to be mapped to an object with properties
Date getStartDate(); Date getEndDate(); int myNumber();
You will be able to do it all declaratively with an IoC framework, including the type conversions!
Max
Matt
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
