checking and modifying CURD
Hibernate+Maven+Struts2——Detailed steps for adding, deleting, checking and modifying CURD
First, let’s take a look at the rendering we want to achieve Next, the blogger’s code structure Go directly to the topic: 1. Create a database table 2. Create a project Create a Maven Project with Eclipse 3. Import hibernate-related rack packages into the project pom.xml 4.0.0 Maven_Hibenate01 Maven_Hibenate01 war 0.0.1-SNAPSHOT Maven_Hibenate01 Maven Webapp http://maven.apache.org -Dfile.encoding=UTF-8 junit junit 4.12 test javax.servlet javax.servlet-api 3.1.0 provided org.hibernate hibernate-core 5.2.10.Final org.apache.struts struts2-core 2.5.12 org.apache.struts struts2-convention-plugin 2.5.12 net.sf.json-lib json-lib 2.4 jdk15 mysql mysql-connector-java 5.1.18 Maven_Hibenate01 4.Configure hibernate.cfg.xml root 123 jdbc:mysql://localhost:3306/test?characterEncoding=utf8 com.mysql.jdbc.Driver 5.Create entity class User.java And the mapping file User.hbm.xml (the mapping file and the entity object must be in the same package) package com.yhl.entity; public class User { private int u_id;//number private String u_name;//User name private String u_sex;//sex public User() { } public User(int u_id) { this.u_id = u_id; } public User(String u_name, String u_sex) { super(); this.u_name = u_name; this.u_sex = u_sex; } public User(int u_id, String u_name, String u_sex) { this.u_id = u_id; this.u_name = u_name; this.u_sex = u_sex; } public int getU_id() { return u_id; } public void setU_id(int u_id) { this.u_id = u_id; } public String getU_name() { return u_name; } public void setU_name(String u_name) { this.u_name = u_name;…