I'm not convinced that the .hbm.xml files are being acted on properly if they are generated in the same "pass" as they are being read in.
I'm reverse-engineering a database in order to generate the POJO classes, "xxxHome" classes, .hbm.xml files and hibernate.cfg.xml file.
I've defined some of my own templates used to generate the .hbm.xml files.
I've then defined some templates used to generate the Java code.
I've found that if I attempt to generate everything in one single pass, the <meta attribute="xxxx">yyyy</meta> inserted into the .hbm.xml files by my templates had no effect on the Java code that was generated.
e.g. my id.hbm.vm template file contains a clause
<meta attribute="scope-set">protected</meta>
If I generate everything in one single "hit" (i.e. exporters for "generate domain code", "JDK1.5 constructs", "generate DAO code", "generate mappings", "generate hibernate configuration" and "generate schema html-documentation" were all ticked), then my setId method remains "public".
If I use two passes; the first pass to generate the hibernate.cfg.xml file and the .hbm.xml files, and the second pass that generates the POJO and xxxHome java code, my setId method is protected (as expected).
Has anyone else seen this or is it just me?
Hibernate tools version: TOOLS_3_1_0_BETA3
|