package com.java.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.java.model.Dept;
import com.java.service.DeptService;
/*
*
* Dept查询是通过自定义sql语句查询
*
*/
@RestController
public class DeptController {
@Autowired
private DeptService deptservice;
//查询所有部门信息
@RequestMapping("getAllDept")
public ModelAndView getAllDept() {
ModelAndView model = new ModelAndView();
model.addObject("listDept",deptservice.getAllDept() );
model.setViewName("AllDept");
return model;
}
//根据部门号查询部门及所有员工信息
@RequestMapping("getAllMessage")
public ModelAndView getAllMessage(@RequestParam(value="did") Long id) {
System.out.println(id);
ModelAndView model = new ModelAndView();
Dept dept = deptservice.getAllMessage(id);
model.addObject("allList",dept );
model.setViewName("DeptAndEmp");
return model;
}
//添加部门信息
@RequestMapping(value="addDept",method=RequestMethod.POST,headers="application/json")
public ModelAndView addDept(@RequestBody Dept dept) {
ModelAndView model = new ModelAndView();
deptservice.addDept(dept);
model.setViewName("success");
return model;
}
}
EmpController.java
package com.java.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.java.service.EmpService;
/*
* EMP 部门查询是通过jpa解析方法名查询
*
*/
@Controller
public class EmpController {
@Autowired
private EmpService empservice;
//查询所有员工信息t
@RequestMapping("getAllEmp")
public ModelAndView getAllEmp(){
ModelAndView model = new ModelAndView();
model.addObject("empList", empservice.getAllEmp());
model.setViewName("AllEmp");
return model;
}
//模糊查询员工信息
@RequestMapping(value = "getLikeEmp",method=RequestMethod.GET)
public ModelAndView getLikeEmp(@RequestParam(value = "name") String name) {
ModelAndView model = new ModelAndView();
System.out.println("name:"+name);
model.addObject("empList", empservice.getLikeEmp("%"+name+"%"));
model.setViewName("AllEmp");
return model;
}
//通过名字查询员工信息
@RequestMapping(value="getEmpByName")
public ModelAndView getEmpByName() {
ModelAndView model = new ModelAndView();
model.addObject("empList", empservice.getEmpByName("lisi"));
model.setViewName("AllEmp");
return model;
}
}
数据层
EmpDao.java
package com.java.dao;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.java.model.Emp;
@Repository
public interface EmpDao extends JpaRepository{
//模糊查询员工信息
public List findByEnameLike(String name);
@Query("select e from Emp e where e.ename =?1")
List findByEname(String name);
}
CMS概述
并发标记清理垃圾回收(Concurrent Mark and Sweep GC)算法的主要目标是在GC过程中,减少暂停用户线程的次数以及在不得不暂停用户线程的请夸功能,尽可能短的暂停用户线程的时间。这对于交互式应用,比如web应用来说,是非常重要的。
CMS垃圾回收针对新生代和老年代采用不同的策略。相比同吞吐量垃圾回收,它要复杂的多。吞吐量垃圾回收在执
1,找到配置文件
vi /etc/sysconfig/iptables
2,添加端口开放,增加一行,开放18081端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 18081 -j ACCEPT
3,保存
ESC
:wq!
4,重启服务
service iptables
使用Android SDK Manager 更新了Anadroid SDK Tooks 之后,
打开eclipse提示 This Android SDK requires Android Developer Toolkit version 23.0.0 or above, 点击Check for Updates
检测一会后提示 No update were found