BibleGateway.com Verse Of The Day

Friday, January 19, 2007

DAO Generator Update

Progress has been somewhat slow, but I fixed some issues with the Velocity templates, as I got a chance to generate the persistence layer for a mini project, which surfaced a few issues.

Also, main bulk of work now is with the custom query generation. At first I started with a custom query tab, then a different tab for each table. That screen got really busy and unusable really fast, so I decided to do more of a popup, screen-by-screen "wizard" type approach.

Click on the table, hit "Custom Method" button...


And it pops up a screen with the current custom methods for that table (if any)....

Then you can edit, delete, or create new. New button launches a screen that will look something like this (but needs some way to display all the parms as they are added, with way to edit or delete parms)....

The DAO generation for stored procedures has been a pain in the butt, so I shelved that chunk for now. One of the databases I ran this against had 2 stored procedures in the same schema with the same name, and as far as I could tell the params looked the same too. That of course puts duplicate methods in the DaoFactory but only generates one DAO class instead of two. Maybe I should just make that whole thing more generic, like the DAO "execute" method takes a single array of parameters instead of being a finely grained typed call. And then the binding is done on the fly. If you sent too many or too few params, you lose, Exception thrown.

Once I get the custom query stuff done, the next chunk of work will be to make this work with other database servers. I can test it against Oracle, MySQL, and SQL-Server without too much effort since I have all those installed on my PC.

No comments: