Get the App
SLTechnology News&Howtos  ›  Database  › 

MyEclipse 2015 Hibernate reverse Engineering

Shulou Source: shulou.com Published: 2022-06-01 10:56:06 10月02日 Update

1. Use DB Browser to establish database connection

Window->Show View->Other... search DB

Create a new database connection in DB Browser

Click "Test Driver" and the following prompt box pops up, indicating that the connection is successful!

DB Browser displays the database connections established as follows

Double-click the "local" database connection to view the Table in the local database

Right-click on the table and select Hibernate Reverse Engineering...

Click Browse to the right of Java src folder...

In the open window, the prompt "No entries available" appears. This problem arises because Hibernate Facet has not been added to the project.

Add Hibernate Facet to your project

Right-click Project--MyEclipse--Project Faces [competencies]--install Hibernate facets

Select Hibernate, generally select version 3.x

If hibernate.cfg.xml already exists, select Existing; if not, select new. The others do not need to be checked, adding hibernate facets here just makes MyEclipse records useful to Hibernate.

The following pages do not need to be checked.

3、Hibernate Reverse Engineering

Go back to DB Browser, right click on the data table and select Hibernate Reverse Engineering...

Click the Browser button on the right side of the Java src folder and select the target package.

Check "Create POJO DB Table mapping information"

"Create a Hibernate mapping file(*.hbm.xml) for each database table"

Check Java Data Object(POJO DB Table)

Delete catalog information from *.hbm.xml file

4. Remove Hibernate Facet from the project

(1) Delete.myhibernatedata file under project

(2) Modify org.eclipse.wst.common.project.facet.core.xml under.settings directory

delete the

(3) Right-click on the project to refresh, you can remove Hibernate logo

Tags: Select data project database file right prompt success no information just button data table useful logo version directory target problem face Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Technology Redmi Apple macOS