David E Jones wrote:
> [snip]
Well, I have thoughts on this. Extend javac.
Basically, add default values to parameter definitions. Javac would
then auto-generate methods to see each default value. Of course, this
is something that has to be done outside of ofbiz; I've compiled
openjdk, but I haven't tried to extend it at all.
I've also had the same bad taste with the delegator. The way you have
you use 2 different methods, based on whether you use caching or not as
always struck me has poor. I'd rather see that done as a flag/parameter
specifying whether caching should be done.
Another possibly is to use annotations to specify things. But I haven't
given much thought to that.
And, yet another mention; I plan on adding pure sql querying to the
delegator. So you can do things like:
delegator.findByQuery("SELECT * FROM Person")
I already have code that can parse sql(it's a jjtree grammar). I wrote
an xslt that converts *all* entitymodel.xml to sql CREATE statements.
Then I wrote code to parse the resulting sql files, and generate correct
JDBC sql code to handling the normal ofbiz column/table mapping. I just
haven't integrated it. My thoughts were to have a framework/entity2,
that talked to the same back-end datastore, so one could use either variant.
Another variant might be this:
Query query = new Query("Person");
query.setSelectFields("partyId", "firstName", "lastName");
query.cacheResults(true);
query.orderBy("lastName", "firstName");
List<GenericValue> people = delegator.runQuery(query);