实体类 package indi.yxq.spring.entity; public class User { private Integer user_id; private String user_name; public User() { System.out.println("User类构造方法"); } public void setUser_id(Integer user_id) { this.user_id = user_id; } public void setUser_name(String user_name) { this.user_name = user_name; } @Override public String toString() { return "User [user_id=" + user_id + ", user_name=" + user_name + "]"; } } package indi.yxq.spring.entity; public class UserDao { private User user; public UserDao() { super(); // TODO Auto-generated constructor stub } public void setUser(User user) { this.user = user; } @Override public String toString() { return "UserDao [user=" + user + "]"; } } package indi.yxq.spring.entity; public class UserHome