[jbosstools-dev] Hbm file generation

Dmitry Geraskov dgeraskov at exadel.com
Mon Feb 2 03:41:44 EST 2009


Hi, Max!

Now hibernate tools hbm file generation works as follows

1. Generate header
2. For each property
    generate element
3. Close body.

All this file body generates to String.

If generation fails at step 2 then file will not be generated at all.

As hbm generation doesn't support many mappings (for example I didn't 
see map.hbm.ftl, set can't be generated with element, etc.) I propose to 
change generation algorithm as follows:
1. Generate header
2. For each property
try{
   append(element generated string);
} catch exception{
    append(<!-- Exception (exceptionName and message) occurred while 
trying to generate this property-->);
   append(<property name="propName" type="'type' if defined or 'string'"/>);
 //or  append(<!--property name="propName" type="type or string"/ -->);
}
3. Close body.

What is your opinion about this?

-- 
Best regards,

 Dmitry Geraskov              
 dgeraskov at exadel.com
 Senior Developer
 Exadel Inc




More information about the jbosstools-dev mailing list