简体   繁体   English

Hibernate3-Maven-Plugin排除生成的文件

[英]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? 有没有一种方法可以指定不要在hbm2java目标中生成的单个类?

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. 在reveng.xml文件中指定不需要的表。 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. 然后在您的配置中引用reveng.xml。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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