• 大小: 15.68MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-06
  • 语言: 其他
  • 标签: springData  jpa  demo  

资源简介

springdata-jpa demo http://knight-black-bob.iteye.com/blog/2274879

资源截图

代码片段和文件信息

package com.curiousby.action;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; 
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; 
import org.springframework.web.bind.annotation.RequestMethod;

import com.curiousby.entity.User;
import com.curiousby.service.UserService;
 

@Controller
public class UserController {

      @Autowired
      UserService service;

      @RequestMapping(value = “/userView.do“)
      public String userView(ModelMap modelMapString pageNo String choice HttpSession session){
            List userList = service.allUser();
           modelMap.put(“userList“ userList);
           return “back/jsp/user/userView“;
     }
 

      @RequestMapping(value = “/userDel{userId}.do“)
      public String userDel(@PathVariable(“userId“)int userId ModelMap modelMapString pageNo String choice HttpSession session){
             service.delUser(userId);
             String message1=“删除成功“;
             String message2=“请返回……“;
             String  url=“userView.do“;
             modelMap.put(“message1“ message1);
             modelMap.put(“message2“ message2);
             modelMap.put(“url“ url);
            return “infomationShow“;
      }

      @RequestMapping(value =“/userGoAdd.do“)
             public String userGoAdd(ModelMap modelMapString pageNo String choice HttpSession session){
             return “back/jsp/user/userAdd“;
      }

      @RequestMapping(value = “/userAdd.do“method=RequestMethod.POST)
      public String userAdd(User formModelMap modelMapString pageNo String choice HttpSession session){
             service.addUser(form);
             String message1=“添加成功“;
             String message2=“请返回……“;
             String  url=“userView.do“;
             modelMap.put(“message1“ message1);
             modelMap.put(“message2“ message2);
            modelMap.put(“url“ url);
             return “infomationShow“;
      }

      @RequestMapping(value = “/userGoUpdate{userId}.do“)
      public String userGoUpdate(@PathVariable(“userId“)int userId ModelMap modelMapString pageNo String choice HttpSession session){
            User user = service.user(userId);
           modelMap.put(“user“ user);
           return “back/jsp/user/userUpdate“;
      }

      @RequestMapping(value = “/userUpdate.do“method=RequestMethod.POST)
      public String userUpdate(User formModelMap modelMapString pageNo String choice HttpSession session){
             service.updateUser(form);
             String message1=“修改成功“;
             String message2=“请返回……“;
             String  url=“userView.do“;
             modelMap.put(“message1“ message1);
             modelMap.put(“message2“ message2);
       

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-01-28 13:06  springData-jpa-demo\
     文件         879  2016-01-28 13:06  springData-jpa-demo\.classpath
     文件        1052  2016-01-28 13:02  springData-jpa-demo\.project
     目录           0  2016-01-28 13:02  springData-jpa-demo\.settings\
     文件         503  2016-01-28 13:02  springData-jpa-demo\.settings\.jsdtscope
     文件         364  2016-01-28 13:02  springData-jpa-demo\.settings\org.eclipse.jdt.core.prefs
     文件         586  2016-01-28 13:06  springData-jpa-demo\.settings\org.eclipse.wst.common.component
     文件         345  2016-01-28 13:02  springData-jpa-demo\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-01-28 13:02  springData-jpa-demo\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-01-28 13:02  springData-jpa-demo\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2016-01-28 13:02  springData-jpa-demo\build\
     目录           0  2016-01-28 17:47  springData-jpa-demo\build\classes\
     目录           0  2016-01-28 13:03  springData-jpa-demo\build\classes\com\
     目录           0  2016-01-28 16:53  springData-jpa-demo\build\classes\com\curiousby\
     目录           0  2016-01-28 13:16  springData-jpa-demo\build\classes\com\curiousby\action\
     文件        3450  2016-01-28 17:10  springData-jpa-demo\build\classes\com\curiousby\action\UserController.class
     目录           0  2016-01-28 13:29  springData-jpa-demo\build\classes\com\curiousby\entity\
     文件        1763  2016-01-28 18:08  springData-jpa-demo\build\classes\com\curiousby\entity\User.class
     目录           0  2016-01-28 16:53  springData-jpa-demo\build\classes\com\curiousby\repository\
     文件         703  2016-01-28 16:58  springData-jpa-demo\build\classes\com\curiousby\repository\UserRepository.class
     目录           0  2016-01-28 13:14  springData-jpa-demo\build\classes\com\curiousby\service\
     文件        1704  2016-01-28 17:16  springData-jpa-demo\build\classes\com\curiousby\service\UserService.class
     目录           0  2016-01-28 13:03  springData-jpa-demo\build\classes\com\curiousby\util\
     文件        1008  2016-01-28 17:47  springData-jpa-demo\build\classes\log4j.properties
     目录           0  2016-01-28 16:53  springData-jpa-demo\config\
     目录           0  2016-01-28 17:41  springData-jpa-demo\src\
     文件        3288  2016-01-28 16:42  springData-jpa-demo\src\applicationContext.xml
     目录           0  2016-01-28 13:02  springData-jpa-demo\src\com\
     目录           0  2016-01-28 16:53  springData-jpa-demo\src\com\curiousby\
     目录           0  2016-01-28 13:16  springData-jpa-demo\src\com\curiousby\action\
     文件        3146  2016-01-28 17:09  springData-jpa-demo\src\com\curiousby\action\UserController.java
............此处省略64个文件信息

评论

共有 条评论