资源简介

spring4 hibernate5 springmvc整合配置项目,简单操作2张表,采用注解事物配置。

资源截图

代码片段和文件信息

package ssm.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import ssm.demo.entity.TableRole;
import ssm.demo.entity.TableUser;
import ssm.demo.service.UserService;

@Controller
public class TableController {

@Autowired
private UserService userService;

@RequestMapping(value=“/“)
public String toLogin(){
return “index“;
}

@RequestMapping(value=“/save.do“)
public void save(){
TableRole role = new TableRole();
role.setId(2);
role.setRoleName(“role1“);
role.setNameDesc(“2“);
TableUser user = new TableUser();
user.setId(2);
user.setUserName(“name1“);
user.setNameDesc(“2“);
userService.save(user role);
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-07 14:41  demo\
     文件        1447  2017-12-07 13:59  demo\.classpath
     文件        1441  2017-12-07 13:57  demo\.project
     目录           0  2017-12-07 13:54  demo\.settings\
     文件         639  2017-12-07 13:48  demo\.settings\.jsdtscope
     文件         155  2017-12-07 13:57  demo\.settings\org.eclipse.core.resources.prefs
     文件         430  2017-12-07 13:55  demo\.settings\org.eclipse.jdt.core.prefs
     文件          90  2017-12-07 13:48  demo\.settings\org.eclipse.m2e.core.prefs
     文件         755  2017-12-07 13:59  demo\.settings\org.eclipse.wst.common.component
     文件         252  2017-12-07 13:59  demo\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2017-12-07 13:48  demo\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-12-07 13:48  demo\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          50  2017-12-07 13:48  demo\.settings\org.eclipse.wst.validation.prefs
     目录           0  2017-12-07 16:11  demo\logs\
     文件        5955  2017-12-07 13:53  demo\pom.xml
     目录           0  2017-12-07 13:57  demo\src\
     目录           0  2017-12-07 13:57  demo\src\main\
     目录           0  2017-12-07 14:50  demo\src\main\java\
     目录           0  2017-12-07 14:50  demo\src\main\java\ssm\
     目录           0  2017-12-07 14:54  demo\src\main\java\ssm\demo\
     目录           0  2017-12-07 14:54  demo\src\main\java\ssm\demo\controller\
     文件         823  2017-12-07 15:33  demo\src\main\java\ssm\demo\controller\TableController.java
     目录           0  2017-12-07 14:58  demo\src\main\java\ssm\demo\dao\
     文件         205  2017-12-07 15:02  demo\src\main\java\ssm\demo\dao\RoleDao.java
     文件         208  2017-12-07 14:58  demo\src\main\java\ssm\demo\dao\UserDao.java
     目录           0  2017-12-07 14:58  demo\src\main\java\ssm\demo\dao\impl\
     文件         793  2017-12-07 15:18  demo\src\main\java\ssm\demo\dao\impl\RoleDaoImpl.java
     文件         761  2017-12-07 15:01  demo\src\main\java\ssm\demo\dao\impl\UserDaoImpl.java
     目录           0  2017-12-07 14:53  demo\src\main\java\ssm\demo\entity\
     文件         632  2017-12-07 15:24  demo\src\main\java\ssm\demo\entity\TableRole.java
     文件         634  2017-12-07 15:24  demo\src\main\java\ssm\demo\entity\TableUser.java
............此处省略50个文件信息

评论

共有 条评论