-
Notifications
You must be signed in to change notification settings - Fork 11
INSERT
Konstantin Triger edited this page Aug 10, 2019
·
9 revisions
Started in Fundamentals, we continue writing tutorial samples with FluentJPA.
Other basic clauses: SELECT, UPDATE, DELETE
FluentQuery query = FluentJPA.SQL((Link link) -> {
INSERT().INTO(viewOf(link, Link::getUrl, Link::getName);
VALUES(row("http://www.google.com", "Google"),
row("http://www.yahoo.com", "Yahoo"),
row("http://www.bing.com", "Bing"));
});FluentQuery query = FluentJPA.SQL((Link link) -> {
INSERT().INTO(viewOf(link, Link::getUrl, Link::getName, Link::getLastUpdate));
VALUES(row("http://www.facebook.com", "Facebook", DATE.literal("2013-06-01")));
});
FluentQuery query = FluentJPA.SQL((Link link) -> {
INSERT().INTO(viewOf(link, Link::getUrl, Link::getName, Link::getLastUpdate));
VALUES(row("https://www.tumblr.com/", "Tumblr", DEFAULT()));
});// same structure - derivation
@Tuple
@Table(name = "link_tmp")
public static class LinkTmp extends Link {
}
FluentQuery query = FluentJPA.SQL((LinkTmp linkTmp,
Link link) -> {
INSERT().INTO(linkTmp);
SELECT(link);
FROM(link);
WHERE(link.getLastUpdate() != null);
});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