Hi there,
I'm actually working on a Project where we want to use Hibernate Pojos and Hibernate 2.1.8 for Persistence, also Java 5.0 and JBoss 4.01. I'm ordered to do that with Roundtrip Enigneering within Ant (also a requirement) which is normally no problem with Hibernate. Because we got an existing DB I used Middlegen from generating the Mappings with XDoclet Tags, hbm2java for the Pojos (XDoclet for Pojos to hbm) and SchemaExport and Update for the SQL stuff and some graphical Tools editing the Database Schema on the fly (Got about 100 Tables so xml Moddeling isn't so handy). So far so good. Now my boss wants selfexplaining names for methods, because of the coding guidelines we are using (mainly the generated method name break KISS). eg The Row Parentid in a table (lets call it WWW --> wer wills wissen <-> who wants to know) has a constrainted to the same table. When generated the POJOS with HBM2JAVA I get getWWW for getting the Parent and getWWWs for getting the kids. Thought I got the chance to write a VM for it that does the trick, but then I encountered that I also have to touch the source of HibernateTools another possiblity was to change the VM of Middlegen and also touching the Source there, but the consequence there will be that on every new release of Middlegen or HibernateTools I have to check if the contribution isn't broken and will still work, being a NONO/NOGO (<-- I personally hate this expression sounds like to my ears like "Shut up fool") for my boss. Then I did a research of Roundtrip tools available. I found some but none supports Java 5.0, so no chance to use them without dropping Java 5.0 and all advantages of using the new features making code more readable.
Then I used JBoss IDE Preview jre 1.5 to generate the Mappings and POJOs from my point of view the generated names are better, namely getWWW for the parent and SetOfWWW (which is ok when adding the Javadoc for it, but I got the feeling that this argue isn't very convincing to my collegues ). Now the problem will be the Ant Task, Hibernate 3 RC1 (even if it can be used for Production, know I got rocket scientists as collegues) and the Pre Stage of JBoss IDE which will be the stronger arguements for not using these tools.
Perhaps some of you guys got an idea what would be best pratice.
thx in advanced and best regards
|