-
Notifications
You must be signed in to change notification settings - Fork 10
UPDATE
Konstantin Triger edited this page Aug 10, 2019
·
3 revisions
Started in Fundamentals, we continue writing tutorial samples with FluentJPA.
Other basic clauses: SELECT, INSERT, DELETE
FluentQuery query = FluentJPA.SQL((LinkTmp linkTmp,
Link link) -> {
UPDATE(linkTmp).SET(() -> {
linkTmp.setRel(link.getRel());
linkTmp.setDescription(link.getDescription());
linkTmp.setLastUpdate(link.getLastUpdate());
});
FROM(link);
WHERE(linkTmp.getId() == link.getId());
});
FluentQuery query = FluentJPA.SQL((Customer cust) -> {
INSERT().INTO(viewOf(cust, Customer::getName, Customer::getEmail));
VALUES(row("Microsoft", "[email protected]"));
ON_CONFLICT(Customer::getName).DO_UPDATE().SET(() -> {
Customer excluded = EXCLUDED();
cust.setEmail(excluded.getEmail() + ";" + cust.getEmail());
});
});
Getting Started
- Introduction
- Setup
- Data Types
- Entities & Tuples
- Sub Queries
- JPA Integration
- Java Language Support
- Directives
- Library
- Returning Results
- JPA Repositories
Examples
Basic SQL DML Statements
Advanced SQL DML Statements
- Common Table Expressions (WITH Clause)
- Window Functions (OVER Clause)
- Aggregate Expressions
- MERGE
- Temporal Tables
Advanced Topics