Idea+maven+hibernate+mysql WEB Project Creation

Source: Internet
Author: User
Tags code tag tomcat server

Idea+maven+hibernate+mysql WEB Project Creation

First, the preparatory work

Download installation and hack files to 192.168.0.2

A project of Ieda can contain multiple module, which can call each other

Equivalent to a workspace in Eclipse contains multiple project

Ii. Creation of the project

First open the software directly click on Create New project, choose Maven on the left window, select the SDK to use for the project on the right, select "Create from Archetype" and select "Maven-archetype-webapp", click " Next "button;

Fill in Groupid,artifactid, default version, click "Next" button

GroupID is the unique identifier of the project organization, which actually corresponds to the structure of the Java package, which is the directory structure of Java in the main directory.
Artifactid is the unique identifier of the project, the name of the actual project, which is the name of the project root directory.

The following page is an overview of the information, for example, click on the "Next" button

Fill in the project name and click the "Finish" button

Select Create Project, right click on "Add Framework support ...", find hibernate in the pop-up window, click "OK"

Now that project creation is complete

Via the File->setting menu, press add a tomcat server

Operation Configuration of the project, through Run->edit configurations ... menu, via the + sign in the upper left corner, select Tomcat Server to enter the configuration interface

Click on the top right corner or select Project Right button "open module setting"

In the Modules tab, set the directory for Source,test and resource

On the Artifacts tab, set the exported content, for example, click "+" to select "Web application:exploded->

From modules ... ", select the project you want to deploy

Set up the items that Tomcat will run, for example, set the previous step to add in

Click Tomcat->run, the app runs up and opens the index.jsp page directly

Third, add spring and Hibernate configuration

Please download the code for the specific code

Iv. Hibernate generating Entity classes

Find the "database" attempt, as shown in

Click "+" to add the database configuration

Create a complete display of the database information such as

The following is a Java entity class generated from a database table, first creating an entity class directory such as

Find Persistence view

Fill out the directory of the exported entity class, select the table to generate the entity class as

The generated code is as follows

corresponding to DAO and service, see Code

Five, shortcut keys

ALT + ENTER import package, auto fix
CTRL + N Find class
Ctrl+shift+n Finding files
Ctrl+alt+l Formatting Code

Ctrl+alt+o Optimizing imported classes and Packages
Alt+insert generate code (such as Get,set method, constructor, etc.)
Ctrl+e or Alt+shift+c recently changed code
Ctrl+r replacing text

Ctrl+f finding text
Ctrl+shift+space Auto-Complete code
CTRL + Space Code hints

Ctrl+alt+space class name or interface name hint

Ctrl+p Method Parameter Hints

Ctrl+shift+alt+n find a method or variable in a class

Alt+shift+c vs. recently modified code

Shift+f6 Refactoring-Renaming
ctrl+shift+ First up key
Ctrl+x Deleting rows
Ctrl+d Copying rows
ctrl+/or ctrl+shift+/Comments (//or/*...*/)
CTRL+J Automatic Code
Ctrl+e recently opened files

CTRL+H Display class structure diagram

Ctrl+q displaying comment documents
Alt+f1 find where the code is located
Alt+1 quickly open or hide the engineering panel

ctrl+alt+ Left/right back to the last viewed location
ALT + Left/right Toggle Code View

ALT + Up/down Fast move location between methods

The Ctrl+shift+up/down code moves up/down.

F2 or SHIFT+F2 highlighting error or warning quick location

When the code tag is entered, press TAB to generate the code.

Select the text, press CTRL+SHIFT+F7, highlight all the text, and press ESC to highlight the disappear.

Ctrl+w selected code, continuous press will have other effects

Select the text, press ALT+F3, look down the same text, and highlight it.

Ctrl+up/down cursor jumps to the first or last line

Ctrl+b quickly open the class or method at the cursor

Idea+maven+hibernate+mysql WEB Project Creation

Related Article

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.