【问题标题】:Hibernate plugin reverse engineering with Oracle使用 Oracle 进行 Hibernate 插件逆向工程
【发布时间】:2015-05-25 12:04:51
【问题描述】:

我正在尝试使用 hibernate3-maven-plugin 从 Oracle 模式中获取 Pojos。

我的问题是,虽然我在 hibernate.properties 文件中指定了我想要连接并获取 pojos 的用户,但插件继续获取系统表实体而不是我拥有的虚拟表中的实体已创建。

所以一个问题可能是用户拥有 sys dba 凭据,但事实并非如此,我什至无法从该 oracle 用户创建表...

hibernate.properties

hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
hibernate.connection.url=jdbc:oracle:thin:@localhost:1521/ORACLE
hibernate.connection.username=DROOLS
hibernate.connection.password=drools
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect

reveng.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC
  "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>
  <schema-selection match-schema="DROOLS"/>
</hibernate-reverse-engineering>

maven插件配置:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>hibernate3-maven-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <hibernatetool>
                    <jdbcconfiguration/>
                </hibernatetool>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>cglib</groupId>
                    <artifactId>cglib-nodep</artifactId>
                    <version>2.2.2</version>
                </dependency>
                <dependency>
                    <groupId>oracle.jdbc.driver</groupId>
                    <artifactId>ojdbc6</artifactId>
                    <version>11.2.0.3</version>
                </dependency>
            </dependencies>
        </plugin>

感谢任何帮助。谢谢!

【问题讨论】:

    标签: java oracle hibernate


    【解决方案1】:

    问题是我没有在 hibernate.properties 即使在 oracle 中用户基本上是一个模式...

    hibernate.default_schema=DROOLS
    

    【讨论】:

      猜你喜欢
      • 2021-05-14
      • 2011-03-13
      • 2012-03-10
      • 2014-11-07
      • 2011-02-20
      • 1970-01-01
      • 2015-02-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多