[jbosstools-dev] Re: Hbm file generation

Max Rydahl Andersen max.andersen at redhat.com
Mon Feb 2 04:32:07 EST 2009


> 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.
That means the user will not be aware of any issues occurring during the 
generation but only see it when he starts
using the mappings and it would be hard to figure out why it was a problem.
Adding in a dummy <property> is definitely not something we should do.

I prefer the generation to fail, rather than to continue going on.

Adding in some exception reporting might be useful (and collect a list 
of errors occurred during generation and show it to the user).
But that should be done after GA since it changes the workflow.

For this specific issue, we should rather spend time adding in the 
missing support, i.e. map.hbm.ftl.

/max



More information about the jbosstools-dev mailing list