【问题标题】:Hibernate reverse engineering in eclipse from SQL Server Express R2来自 SQL Server Express R2 的 Eclipse 中的 Hibernate 逆向工程
【发布时间】:2016-08-07 23:35:40
【问题描述】:

我正在从事 Spring 和 Hibernate 项目,我需要进行逆向工程。

我正在使用 SQL Server Express R2 2008。

我已经生成了包含这个源代码的 Hibernate 控制台配置文件(hibernate.cfg.xml):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
        <property name="hibernate.connection.password">sa</property>
        <property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost:1433/supervision</property>
        <property name="hibernate.connection.username">sa</property>
        <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
        <property name="hibernate.default_schema">dbo</property>
    </session-factory>
</hibernate-configuration>

之后我尝试生成 Hibernate 逆向工程文件 (reveng.xml)。

我已经指定了配置,但我总是遇到问题:

获取数据库元数据时读取架构错误

如图所示:

为了澄清一点,有一些类似的话题。我阅读了它们,但它们并没有解决我的问题。

【问题讨论】:

  • 有人可以帮帮我吗?

标签: sql-server eclipse hibernate sql-server-2008 hibernate-mapping


【解决方案1】:

问题出在服务器实例中。 默认情况下,SQL Server Express 不在 1433 端口侦听。 默认情况下禁用 TCP/IP。

我在与 SQL Server 一起安装的 SQL Server 配置管理器中解决了这个问题。 我选择了 SQL Server Network Configuration 和 Protocols for the Instance。 我启用了 TCP/IP,然后我在 TCP 动态端口中指定了 1433 之后,我重新启动了 SQL Server 实例。

【讨论】:

    猜你喜欢
    • 2011-01-01
    • 1970-01-01
    • 2012-03-15
    • 2011-03-13
    • 1970-01-01
    • 2011-02-20
    • 1970-01-01
    • 2016-11-23
    • 1970-01-01
    相关资源
    最近更新 更多