Hibernate 工具逆向工程不起作用
Hibernate tools reverse engineering is not working
我在 Eclipse Neon 中使用 Hibernate 工具(JBoss 工具 4.4.0.Final)。现在我想将数据库表反向工程为 POJO 对象和 Hibernate 映射文件。
我遵循了一些关于如何设置 Eclipse 以生成 POJO 对象的教程。在我 运行 配置之前,一切看起来都很棒。什么都没有发生,也没有抛出任何错误。有人可以帮我弄这个吗?数据库是 MS SQL 服务器 2014.
我的逆向工程配置文件如下所示:
<?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>
<type-mapping>
<sql-type jdbc-type="NVARCHAR" hibernate-type='String'
not-null="true">
</sql-type>
</type-mapping>
<table-filter match-name="Application" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="Company" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="Functionality" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="GeneralSettings" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="Logging" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="Role" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="RoleFunctionality"
match-catalog="Framework" match-schema="dbo">
</table-filter>
<table-filter match-name="Tracing" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="User" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="UserCompany" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="UserRole" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="userSettings" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="sysdiagrams" match-catalog="Framework"
match-schema="dbo" exclude="true">
</table-filter>
</hibernate-reverse-engineering>
通过将逆向工程文件更改为有效文件来解决此问题。 Eclipse Hibernate 工具未生成有效的逆向工程文件。
将文件更改为:
<?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-catalog="Framework"/>
<type-mapping>
<sql-type jdbc-type="NVARCHAR" hibernate-type="string"/>
</type-mapping>
<table-filter match-name="GeneralSettings"/>
<table-filter match-name="Tracing"/>
<table-filter match-name="userSettings"/>
<table-filter match-name="UserRole"/>
<table-filter match-name="Functionality"/>
<table-filter match-name="Application"/>
<table-filter match-name="User"/>
<table-filter match-name="UserCompany"/>
<table-filter match-name="RoleFunctionality"/>
<table-filter match-name="Role"/>
<table-filter match-name="Logging"/>
<table-filter match-name="Company"/>
</hibernate-reverse-engineering>
我在 Eclipse Neon 中使用 Hibernate 工具(JBoss 工具 4.4.0.Final)。现在我想将数据库表反向工程为 POJO 对象和 Hibernate 映射文件。
我遵循了一些关于如何设置 Eclipse 以生成 POJO 对象的教程。在我 运行 配置之前,一切看起来都很棒。什么都没有发生,也没有抛出任何错误。有人可以帮我弄这个吗?数据库是 MS SQL 服务器 2014.
我的逆向工程配置文件如下所示:
<?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>
<type-mapping>
<sql-type jdbc-type="NVARCHAR" hibernate-type='String'
not-null="true">
</sql-type>
</type-mapping>
<table-filter match-name="Application" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="Company" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="Functionality" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="GeneralSettings" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="Logging" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="Role" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="RoleFunctionality"
match-catalog="Framework" match-schema="dbo">
</table-filter>
<table-filter match-name="Tracing" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="User" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="UserCompany" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="UserRole" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="userSettings" match-catalog="Framework"
match-schema="dbo">
</table-filter>
<table-filter match-name="sysdiagrams" match-catalog="Framework"
match-schema="dbo" exclude="true">
</table-filter>
</hibernate-reverse-engineering>
通过将逆向工程文件更改为有效文件来解决此问题。 Eclipse Hibernate 工具未生成有效的逆向工程文件。
将文件更改为:
<?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-catalog="Framework"/>
<type-mapping>
<sql-type jdbc-type="NVARCHAR" hibernate-type="string"/>
</type-mapping>
<table-filter match-name="GeneralSettings"/>
<table-filter match-name="Tracing"/>
<table-filter match-name="userSettings"/>
<table-filter match-name="UserRole"/>
<table-filter match-name="Functionality"/>
<table-filter match-name="Application"/>
<table-filter match-name="User"/>
<table-filter match-name="UserCompany"/>
<table-filter match-name="RoleFunctionality"/>
<table-filter match-name="Role"/>
<table-filter match-name="Logging"/>
<table-filter match-name="Company"/>
</hibernate-reverse-engineering>