他のソース ファイルを生成するだけでなく、DAO クラスの 1 つのファクトリ クラス (DAOFactory.java) も生成したいと考えています。私はその目的のために hbmtemplate を使用しています - 私自身の *.ftl ファイルで。問題は、(私が正しく理解しているように)データベース内のエンティティごとにファイルが生成されることです。そのファイルを一度だけ生成することは可能ですか?
私の pom.xml の一部:
<execution>
<id>hbmtemplate0</id>
<phase>generate-sources</phase>
<goals>
<goal>hbmtemplate</goal>
</goals>
<configuration>
<components>
<component>
<name>hbmtemplate</name>
<outputDirectory>src/main/java</outputDirectory>
</component>
</components>
<componentProperties>
<revengfile>/src/main/resources/hibernate.reveng.xml</revengfile>
<propertyfile>src/main/resources/database.properties</propertyfile>
<jdk5>false</jdk5>
<ejb3>false</ejb3>
<packagename>my.package.name</packagename>
<format>true</format>
<haltonerror>true</haltonerror>
<templatepath>src/main/resources/reveng.templates/</templatepath>
<filepattern>DAOFactory.java</filepattern>
<template>DAOFactory.java.ftl</template>
</componentProperties>
</configuration>
</execution>