Or how to turn this:
into this:
#!/usr/bin/env bash | |
# This script is meant to build and compile every protocolbuffer for each | |
# service declared in this repository (as defined by sub-directories). | |
# It compiles using docker containers based on Namely's protoc image | |
# seen here: https://github.com/namely/docker-protoc | |
set -e | |
REPOPATH=${REPOPATH-/opt/protolangs} | |
CURRENT_BRANCH=${CIRCLE_BRANCH-"branch-not-available"} |
Để tạo được một column có kiểu là NUMBER
mà giá trị của column đó có thể tự động tăng khi thực hiện câu lệnh INSERT
trong hệ quản trị cơ sở dữ liệu Oracle ta sẽ phải sử dụng đến SEQUENCE
kết hợp với TRIGGER
.
Muốn thực hiện được điều này, đầu tiên phải tạo một SEQUENCE
:
CREATE SEQUENCE name_of_sequence
START WITH 1
INCREMENT BY 1
MAX VALUE 999999
CACHE 100;
// @org.springframework.security.access.prepost.PreAuthorize | |
@Transactional | |
@PreAuthorize("hasRole('ROLE_ADMIN')") | |
public void removeContact(int id) { | |
contactDao.removeContact(id); | |
} |
// @org.springframework.web.bind.annotation.RequestParam | |
@Controller | |
@RequestMapping("/user") | |
public class LoginController { | |
@RequestMapping("/login") | |
public String listCompanies(@RequestParam String username, @RequestParam String password) { | |
if(username.equals("admin") && password.equals("mypass")){ | |
return "welcome"; | |
} else { |
// @org.springframework.web.bind.annotation.RequestMapping | |
@Controller | |
@RequestMapping("/login") | |
public class LoginController { | |
@Autowired | |
private UserService userService; | |
... | |
} |
// @org.springframework.stereotype.Controller | |
@Controller | |
public class LoginController { | |
... | |
} |
// @org.springframework.transaction.annotation.Transactional | |
@Service | |
@Transactional(readOnly = true) | |
public class BookServiceImpl implements BookService { | |
@Autowired | |
private BookDao bookDao; | |
@Transactional | |
public Book findByName(String name) { |
// @org.springframework.stereotype.Service | |
@Service | |
public class BookServiceImpl implements BookService { | |
... | |
} |