简体   繁体   中英

Hibernate3-Maven-Plugin Exclude Generated Files

I have a class or two that shouldn't be generated on the mapping process. Is there a way that I can specify the individual classes not to generate in the hbm2java Goal?

I have the plugin configuration as follows:

<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>3.0</version>
<executions>
    <execution>
        <id>hbm2java</id>
        <phase>generate-sources</phase>
        <goals>
            <goal>hbm2java</goal>
        </goals>
        <inherited>false</inherited>

        <configuration>
            <hibernatetool>
                <annotationconfiguration propertyFile="src/main/resources/hibernate.cfg.xml" />
                <hbm2java jdk5="true" ejb3="true"/>
            </hibernatetool>

        </configuration>
    </execution>
</executions>

Specify the tables you don't want in a reveng.xml file. Eg

<table-filter match-name="TABLE_A" exclude="true" />
<table-filter match-name="TABLE_B" exclude="true" />

And then reference the reveng.xml in your configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM