Idea connection database automatically generates entity classes

Source: Internet
Author: User

1. Connect to Database (1) Press, click View-----Select tool Windows----------Select Database and click

(2) Pop Up the Database window, click the plus sign------------Select the data source---------------Select the databases you want to add and click

(3) Pop up the datasources and Drivers window and fill in the circled box respectively. Host-----Write IP address database-------write the name user-------write an account password------write the password, you can click Test Connection, if the connection is successful, then test The right side of the connection button displays a word indicating that the connection was successful. When the connection is successful, click OK in the lower right corner.

(4) After clicking OK, the following results appear, and a database appears.

Two. Add JPA 1. Click File first to see project Structure

2. Click Modules and click on the + sign. I'm using the JPA here

Three. Generate Entity (1) Press, click View---------Select tool windows---------------------Select Persistence and click

(2) Click Persistence will appear persistence window, persistence below the database we connected, is the arrow pointing.

(3) Press, select and click the added database------------------Select Generate Persistence Mapping---------Select by database schema and click

(4) Click by Database Schema, pop up as window, fill in the circled part choose Data Source------------------------ Click on the lower right triangle to select a database package----------------------Select one of the packages in the project, the resulting entity will become a class file placed under that package the third part shows the table of the database, each table generates an entity, tick the table that wants to generate the entity, Then press OK in the lower right corner. This allows the entity to be generated.

Idea connection database automatically generates entity classes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.