Continuing on this, I am just wondering on the best pracitices or the approach taken by others.
In my case, if I have a legacy database, I use middlegen to generate the mapping file (with xdoclet-hibernate tags turned on) and then create the java code. Once I have the java code, I edit the tags to add more information like "type" or "sql-type" since middlegen screws up with the NUMBER (n,n) format, "length". I can then add additional functions to my liking. This becomes my source code the , I use the top-down approach to recreate the mapping files any time attributes get chaged.
In case I don't have a legacy database, I follow the middle approach where in I create the mapping file with the hibernate tags and then generate the java code. Once I jave the java code, I then check the tags and then revert back to top-down approach.
I am just trying to look at the ways to reduce the time taken to setup a persistence layer and I find that at some point or other, I have to edit the java code to put in some custom function. Therefore I have to ultimately revert to top down approach.
Does anyome have a better approach and would be willing to share it here.
Thanks
|