Hibernate reverse engineering Eclipse implementation

1. Hibernate plug-in installation (if you have installed it, you can skip it)
. Install the plug-in online through Help->Install New Software of Eclipse. The plug-in connection is:

eclipse helios (3.6) version 
add the following address: http://download.jboss.org/jbosstools/updates/stable/helios/ 
selective installation: hibernate tools under the All Jboss tools node


Add the following address for eclipse indigo (3.7) version  : http://download.jboss.org/jbosstools/updates/development/indigo/selective 
installation

Other versions
Download by yourself: http://www.jboss.org/tools/download.html

I used the latest version of eclipse version juno (4.2.2),

The address is: http://download.jboss.org/jbosstools/updates/stable/juno/

As shown below:

Then click Next to agree to the installation. The installation time will take about 5-10 minutes, depending on your internet speed.

2. Hibernate reversely generates entity classes
. All the following operations are based on MySQL database. Other databases such as SQL Server and Oracle are similar to Oracle operations. I believe that as long as you can figure out the reverse-engineering entity classes of the MySQL database, you can easily handle other databases.

SQL Server reverse generation entity class reference: http://www.cnblogs.com/whjblogs/p/3137385.html

Then right-click in the open window and click Add Configuration...

1. Open the Data Management in Eclipse and connect to your database

è¿éåå¾çæè¿ °

Then select the database, MySQL used here, and give a name, such as Mysql.

Fill in the database connection configuration according to your own situation

 

Then click Next, and after confirming that it is correct, click Finish.

After Data Management, the Mysql database resource manager will appear. The following changes indicate that the database configuration is successful.

Two: Open the Hibernate Configurations view, menu Window -> Show View -> Other... (the operation is the same as above)

 

Guess you like

Origin blog.csdn.net/qq_30764991/article/details/102067273