Step 1: Install hibernate tools 1. log on to the JBoss website to download the plug-in. Http://www.jboss.org/tools/download.html 2. Select update sites to install the hibernate plug-in. Http://www.jboss.org/tools/download/dev I chose to install the 3.2bata2 development edition. You can select the 3.1ga official edition. Supplement: the preceding two websites may not be available. You can try the following URL. Install the hibernate plug-in Http://download.jboss.org/jbosstools/updates/development Http://download.jboss.org/jbosstools/updates/stable/ 3. After hibernate tools is successfully installed, create a new Java project named hibernatetest. Click Finish and add the hibernate library file and the MySQL driver as follows: Open the hibernate deployments view, and choose Window> show View> other...
In the blank area of the hibernate tolerations view, right-click Add tolerations. Here we enter the "hibernate" name. You can name it another one and it will be called later. The pop-up configuration window is as follows:
Project: browse select a project for Reverse Engineering Database Connection: hibernate configured connection Configuration File: Setup
Fill in the data connection related content, such as IP address, database name, account, password, etc. Click Finish to complete the configuration.
The following code is generated based on the configuration.
Double-click or right-click to create a new configuration
After the configuration name is modified, click Apply.
Console configuration: select the created hibernate Configuration Output directory: select the project name/src directory for the output directory. Package name: www. DB. pojo.
Switch to the exporter tab to continue setting Click Apply to complete the settings. Click Run to generate a Java object class based on the database.
The running result is as follows: Because the generated object class implements java. Io. serializable, a yellow exclamation point is generated by right-clicking
Eclipse J2EE 3.6.1: Help Menu-> install new software...
Alternatively, you can download the plug-in for local installation.
|