monksy
monksy

Reputation: 14234

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>

Upvotes: 1

Views: 525

Answers (1)

Andy N
Andy N

Reputation: 1304

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

<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.

Upvotes: 0

Related Questions