This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO employees(employeeid, lastname, firstname, payment) | |
VALUES (1, 'McDonald', 'Carl', 1000) | |
SELECT xmin, xmax, employeeid, lastname, firstname, payment | |
FROM employees WHERE firstname = 'Carl'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
SELECT txid_current(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE employees | |
SET payment=5000 | |
WHERE employeeid = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT xmin, xmax, employeeid, lastname, firstname, payment | |
FROM public.employees; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT employeeid, lastname, firstname, payment | |
FROM public.employees; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO employees( | |
employeeid, lastname, firstname, payment) | |
VALUES (1, 'John', 'Smith', 3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_embedded": { | |
"accounts": [ | |
{ | |
"number": "100", | |
"money": 1500, | |
"clientName": "Thomas Johnson", | |
"_links": { | |
"self": { | |
"href": "http://localhost:8080/accounts/1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Projection(name = "accountProjection", types = {Account.class}) | |
public interface AccountProjection { | |
@Value("#{target.getClient().getName()}") | |
String getClientName(); | |
Integer getMoney(); | |
String getNumber(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Repository | |
public interface AccountRepository extends CrudRepository<Account, Integer> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping("/accounts") | |
public class AccountsController { | |
private final AccountService accountService; | |
@Autowired | |
public AccountsController(AccountService accountService) { | |
this.accountService = accountService; | |
} |