【问题标题】:What is the right configuration for hibernate4-maven-plugin to generate PostgreSQL schemas?hibernate4-maven-plugin 生成 PostgreSQL 模式的正确配置是什么?
【发布时间】:2014-06-23 03:03:51
【问题描述】:

我一直在尝试通过 hibernate4-maven-plugin 生成 PostgreSQL 模式,该模式的创建方式与我为 MySQL 所做的相同,但没有找到任何资源。

这是MySQL版本的maven插件设置:

<plugin>
    <groupId>de.juplo</groupId>
    <artifactId>hibernate4-maven-plugin</artifactId>
    <version>1.0.1</version>
    <executions>
        <execution>
            <goals>
                <goal>export</goal>
            </goals>
        </execution>
    </executions>

    <configuration>
        <driverClassName>com.mysql.jdbc.Driver</driverClassName>
        <hibernateDialect>org.hibernate.dialect.MySQL5Dialect</hibernateDialect>
        <username>testuser</username>
        <password>testpasswd</password>
        <url>jdbc:mysql://localhost:3306/mydb</url>
        <target>BOTH</target>
    </configuration>
</plugin>

【问题讨论】:

    标签: hibernate postgresql maven plugins schema


    【解决方案1】:

    稍微调整一下参数后,我也让它与PostgreSQL 一起工作。

    以下是对我来说非常有用的 maven 设置:

    <plugin>
        <groupId>de.juplo</groupId>
        <artifactId>hibernate4-maven-plugin</artifactId>
        <version>1.0.3</version>
        <executions>
            <execution>
                <goals>
                    <goal>export</goal>
                </goals>
            </execution>
        </executions>
    
        <configuration>
            <driverClassName>org.postgresql.Driver</driverClassName>
            <hibernateDialect>org.hibernate.dialect.PostgresPlusDialect</hibernateDialect>
            <username>postgres</username>
            <password>postgres</password>
            <url>jdbc:postgresql://localhost:5432/mydb</url>
            <target>BOTH</target>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>9.1-901.jdbc4</version>
            </dependency>
        </dependencies>
    
    </plugin>
    

    【讨论】:

      猜你喜欢
      • 2015-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-20
      • 2012-10-19
      • 2012-10-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多