How to realize reverse Engineering with hibernate
This article will explain in detail how to achieve reverse engineering in hibernate. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Import hibernate plug-in, this own Baidu.
two。 Displays Data, if present, skip it.
Click OK, as shown below:
3. Configure Data
Right click, new, as shown in the figure
Select the database you use. Name: the name is defined by yourself.
After clicking on next, the following picture, which I originally configured, shows this effect after configuration.
If this is the first time to configure, there is nothing, refer to the next figure.
For the first time, refer to the figure:
After clicking, as shown in the following figure, select the version of the database you use.
Then click JAR List to select the database jar package driver.
After the driver is added, it will be configured. Click Properties, and after configuration, click ok.
Test whether the configuration is successful
4. Show hibernate. If you already have one, you can skip this step
After clicking ok, the effect is as shown in the figure.
5. Configure hibernate database connection mapping profile
The configuration steps are shown in the figure:
After clicking add configuration, the page is shown in the picture.
After the db.per line, click setup. If it is the first time to use it, click create new.
Then, select the path where the configuration file is stored, which is outlined in this step.
After selecting the configuration file, it is shown in the figure: complete the following configurations that need to be added.
6. How to display Hibernate Code Generation Configu.., if yours is already displayed, please skip it.
The steps are shown in the following figure:
7. Configure hibernate Code Generation
To map the function, select it.
Here's the coding.
8. Through the database, select the mapping file you want to generate
After selecting, then ctrl + s to save it.
8. The last step is to generate the mapping file
Click Run to generate the desired file.