forked from NeilAlishev/SpringCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBatchController.java
More file actions
38 lines (32 loc) · 954 Bytes
/
BatchController.java
File metadata and controls
38 lines (32 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package ru.alishev.springcourse.controllers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import ru.alishev.springcourse.dao.PersonDAO;
/**
* @author Neil Alishev
*/
@Controller
@RequestMapping("/test-batch-update")
public class BatchController {
private final PersonDAO personDAO;
@Autowired
public BatchController(PersonDAO personDAO) {
this.personDAO = personDAO;
}
@GetMapping()
public String index() {
return "batch/index";
}
@GetMapping("/without")
public String withoutBatch() {
personDAO.testMultipleUpdate();
return "redirect:/people";
}
@GetMapping("/with")
public String withBatch() {
personDAO.testBatchUpdate();
return "redirect:/people";
}
}