I've written a system generate Entity and Session beans using the Template Toolkit. Works great. First step is to use JDBC to generate a textfile of information about the tables -- JDBC has access to much more metadata than DBI. Then a perl script and a series of classes use the Template Toolkit along with the data to build the various beans and deployment descriptors.
The nice thing about using this system is that it makes designing much more flexible. If we want to use a different way to represent relationships between tables/beans, we just code it once and regenerate the beans. And it enables us to quickly accommodate changes to the database schema as well, or even create a metadata text file based on versions of the database.
Let me know if you have any specific questions.
Chris
M-x auto-bs-mode
|