简体   繁体   English

表中的DB2 JPA实体

[英]DB2 JPA entities from table

I'm trying to generate JPA entities from table through the Eclipse Wizard. 我正在尝试通过Eclipse向导从表生成JPA实体。 The database is AS400-DB2. 该数据库是AS400-DB2。 I've set the properties in this way: database: ACG_COMTST URL: jdbc:as400://192.168.3.54 username: username password: password 我以这种方式设置了属性:数据库:ACG_COMTST URL:jdbc:as400://192.168.3.54用户名:用户名密码:密码

ACG_COMTST is the AS400 library. ACG_COMTST是AS400库。

When I press test connection I get success. 当我按测试连接时,我会成功。 But I can't see any table to select in the wizard 但是我看不到向导中要选择的任何表

Dali, the Eclipse plug-in that supplies the entity generation wizard you are using, relies on another Eclipse plug-in, DTP, to provide the database metadata necessary to perform the entity generation. Dali是提供您正在使用的实体生成向导的Eclipse插件,它依赖于另一个Eclipse插件DTP提供执行实体生成所必需的数据库元数据。 As a result, this problem could be caused by either plug-in. 结果,此问题可能是由任何一个插件引起的。

A simple way to (possibly) isolate the problem is to use DTP's Data Source Explorer view to see what DTP is returning in the way of metadata. 一种(可能)隔离问题的简单方法是使用DTP的“数据源资源管理器”视图查看DTP以元数据方式返回的内容。 Use this view to connect to your AS400-DB2 database. 使用此视图连接到AS400-DB2数据库。 (You will be using the same connection profile you created in the Dali Entity Generation wizard.) Once you are connected you should be able to expand the tree to see your tables. (您将使用在Dali Entity Generation向导中创建的相同连接配置文件。)建立连接后,您应该能够展开树以查看表。 If there are no tables, the problem is with the DTP adapter used to retrieve metadata from your database and this is a problem with DTP; 如果没有表,则说明用于从数据库中检索元数据的DTP适配器有问题,这是DTP的问题。 if there are tables in the tree, the problem is with Dali. 如果树中表格,则问题出在大理。

Also, you should look at the Eclipse log (./.metadata/.log) to see if any sort of exception occurs when you are using the Dali wizard. 另外,您应该查看Eclipse日志(./.metadata/.log),以查看使用Dali向导时是否发生任何异常。

I just spent a half a morning trying to figure this out myself. 我只花了一个半天的时间试图自己解决这个问题。 The answer lies in the "Override default catalog from connection" about halfway down the Project|Properties|JPA page. 答案就在“项目|属性| JPA”页面的大约一半处的“从连接中覆盖默认目录”中。 You must set this to the actual catalog that holds your schema, typically the server name. 您必须将其设置为保存模式的实际目录,通常是服务器名称。 It defaults to the username you provide for the connection. 默认为您为连接提供的用户名。

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

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