简体   繁体   中英

Can't generate entities from database using JPA tools

I'm using JPA Tools to generate the entity classes from an existing database following this tutorial:

http://o7planning.org/web/fe/default/en/document/7758/using-hibernate-tools-generate-entity-classes-from-tables

I setup the connection, but when I try to right-click on the project name > JPA Tools > Generate Entities from Tables, I select the connection and the schema, but no table is shown to select

在此处输入图片说明

but of course I have a few tables in the database with the same name. This is a picture from Sequel Pro:

在此处输入图片说明

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. 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. Use this view to connect to your database. (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. 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; 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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