AstVisitor, DeleteFirstStep, InsertIntoFirstStep, SelectFirstStep, UpdateFirstStep, WithAsManySteps, WithAsSteppublic class WithImpl extends java.lang.Object implements AstVisitor, WithAsStep, WithAsManySteps, SelectFirstStep, InsertIntoFirstStep, UpdateFirstStep, DeleteFirstStep
| Constructor | Description |
|---|---|
WithImpl(java.lang.String name,
boolean recursive,
java.lang.String... columns) |
|
WithImpl(java.lang.String name,
java.lang.String... columns) |
| Modifier and Type | Method | Description |
|---|---|---|
WithImpl |
as(Query query) |
Specifies sub-queries
|
WithImpl |
as(Expression query) |
Specifies sub-queries
|
void |
assemble(AbstractSyntaxTree tree) |
Visits SQL query making a tree from its clauses.
|
DeleteAsStep |
deleteFrom(java.lang.String name) |
DELETE statement.
|
DeleteAsStep |
deleteFrom(Expression name) |
DELETE statement.
|
DeleteAsStep |
deleteFromOnly(java.lang.String name) |
DELETE statement.
|
DeleteAsStep |
deleteFromOnly(Expression name) |
DELETE statement.
|
InsertAsStep |
insertInto(java.lang.String table) |
INSERT INTO statement.
|
InsertAsStep |
insertInto(Expression table) |
INSERT INTO statement.
|
SelectFromStep |
select(Expression... columns) |
SELECT statement.
|
<T> SelectFromStep |
select(T... columns) |
SELECT statement.
|
SelectFromStep |
selectAll(Expression... columns) |
SELECT ALL statement.
|
<T> SelectFromStep |
selectAll(T... columns) |
SELECT ALL statement.
|
SelectFromStep |
selectDistinct(Expression... columns) |
SELECT DISTINCT statement.
|
<T> SelectFromStep |
selectDistinct(T... columns) |
SELECT DISTINCT statement.
|
<T> SelectFromStep |
selectDistinctOn(java.lang.String[] distinct,
T... columns) |
SELECT DISTINCT ON (..) ..
|
SelectFromStep |
selectDistinctOn(Expression[] distinct,
Expression... columns) |
SELECT DISTINCT ON (..) ..
|
UpdateAsStep |
update(java.lang.String name) |
UPDATE statement.
|
UpdateAsStep |
update(Expression name) |
UPDATE statement.
|
UpdateAsStep |
updateOnly(java.lang.String name) |
UPDATE statement.
|
UpdateAsStep |
updateOnly(Expression name) |
UPDATE statement.
|
WithImpl |
with(java.lang.String name,
java.lang.String... columns) |
public WithImpl(java.lang.String name,
java.lang.String... columns)
public WithImpl(java.lang.String name,
boolean recursive,
java.lang.String... columns)
public final WithImpl as(Query query)
WithAsStepas in interface WithAsStepquery - CTE's querypublic final WithImpl as(Expression query)
WithAsStepas in interface WithAsStepquery - CTE's querypublic final WithImpl with(java.lang.String name, java.lang.String... columns)
with in interface WithAsManyStepspublic void assemble(AbstractSyntaxTree tree)
AstVisitorassemble in interface AstVisitortree - - abstract syntax tree@SafeVarargs public final <T> SelectFromStep select(T... columns)
select("id", "name", 3); // SELECT id, name, 3
select in interface SelectFirstStepcolumns - output columnspublic final SelectFromStep select(Expression... columns)
select(asName("id"), asName("name")); // SELECT id, name
select in interface SelectFirstStepcolumns - output columns@SafeVarargs public final <T> SelectFromStep selectAll(T... columns)
selectAll("id", "name"); // SELECT ALL id, name
selectAll in interface SelectFirstStepcolumns - output columnspublic final SelectFromStep selectAll(Expression... columns)
select(asName("id"), asName("name")); // SELECT id, name
selectAll in interface SelectFirstStepcolumns - output columns@SafeVarargs public final <T> SelectFromStep selectDistinct(T... columns)
selectDistinct("id", "name"); // SELECT DISTINCT id, name
selectDistinct in interface SelectFirstStepcolumns - output columnspublic final SelectFromStep selectDistinct(Expression... columns)
selectDistinct(asName("id"), asName("name")); // SELECT DISTINCT id, name
selectDistinct in interface SelectFirstStepcolumns - output columns@SafeVarargs public final <T> SelectFromStep selectDistinctOn(java.lang.String[] distinct, T... columns)
String[] distinct = {"id"};
selectDistinctOn(distinct, "id", "name"); // SELECT DISTINCT ON (id) id, name
selectDistinctOn in interface SelectFirstStepcolumns - output columnspublic final SelectFromStep selectDistinctOn(Expression[] distinct, Expression... columns)
Expression[] distinct = {"id"};
selectDistinctOn(distinct, asName("id"), asName("name")); // SELECT DISTINCT ON (id) id, name
selectDistinctOn in interface SelectFirstStepcolumns - output columnspublic final InsertAsStep insertInto(java.lang.String table)
InsertIntoFirstStep
insertInto("book")
.as("b")
.columns("id", "name")
.overridingSystemValue()
.values(1, "test")
.onConflict()
.onConstraint("index_name")
.doNothing()
.sql()
insertInto in interface InsertIntoFirstSteptable - target table namepublic final InsertAsStep insertInto(Expression table)
InsertIntoFirstStep
insertInto(asName("book"))
.as("b")
.columns("id", "name")
.overridingSystemValue()
.values(1, "test")
.onConflict()
.onConstraint("index_name")
.doNothing()
.sql()
insertInto in interface InsertIntoFirstSteptable - target table namepublic final UpdateAsStep update(java.lang.String name)
UpdateFirstStep
// UPDATE book AS b SET author = 'Andrew' WHERE b.id = 1 RETURNING max(price) AS price
update("book")
.as("b")
.set("author", asConstant("Andrew"))
.where("b.id", "=", 1)
.returning(asName("max(price)").as("price"))
.sql();
update in interface UpdateFirstStepname - name of the table ot updatepublic final UpdateAsStep update(Expression name)
UpdateFirstStep
// UPDATE book AS b SET author = 'Andrew' WHERE b.id = 1 RETURNING max(price) AS price
update(asName("book"))
.as("b")
.set("author", asConstant("Andrew"))
.where("b.id", "=", 1)
.returning(asName("max(price)").as("price"))
.sql();
update in interface UpdateFirstStepname - name of the table ot updatepublic final UpdateAsStep updateOnly(java.lang.String name)
UpdateFirstStep
// UPDATE ONLY book AS b SET author = 'Andrew' WHERE b.id = 1 RETURNING max(price) AS price
updateOnly("book")
.as("b")
.set("author", asConstant("Andrew"))
.where("b.id", "=", 1)
.returning(asName("max(price)").as("price"))
.sql();
updateOnly in interface UpdateFirstStepname - name of the table ot updatepublic final UpdateAsStep updateOnly(Expression name)
UpdateFirstStep
// UPDATE ONLY book AS b SET author = 'Andrew' WHERE b.id = 1 RETURNING max(price) AS price
updateOnly(asName("book"))
.as("b")
.set("author", asConstant("Andrew"))
.where("b.id", "=", 1)
.returning(asName("max(price)").as("price"))
.sql();
updateOnly in interface UpdateFirstStepname - name of the table ot updatepublic final DeleteAsStep deleteFrom(java.lang.String name)
DeleteFirstStep
// DELETE FROM book AS b USING author, order WHERE b.id = 1 RETURNING id
deleteFrom("book")
.as("b")
.using("author", "order")
.where("b.id", "=", "1")
.returning(asName("id")
.sql()
deleteFrom in interface DeleteFirstStepname - target table namepublic final DeleteAsStep deleteFrom(Expression name)
DeleteFirstStep
// DELETE FROM book AS b USING author, order WHERE b.id = 1 RETURNING id
deleteFrom(asName("book"))
.as("b")
.using("author", "order")
.where("b.id", "=", "1")
.returning(asName("id")
.sql()
deleteFrom in interface DeleteFirstStepname - target table namepublic final DeleteAsStep deleteFromOnly(java.lang.String name)
DeleteFirstStep
// DELETE FROM ONLY book AS b USING author, order WHERE b.id = 1 RETURNING id
deleteFromOnly("book")
.as("b")
.using("author", "order")
.where("b.id", "=", "1")
.returning(asName("id")
.sql()
deleteFromOnly in interface DeleteFirstStepname - target table namepublic final DeleteAsStep deleteFromOnly(Expression name)
DeleteFirstStep
// DELETE FROM ONLY book AS b USING author, order WHERE b.id = 1 RETURNING id
deleteFromOnly(asName("book"))
.as("b")
.using("author", "order")
.where("b.id", "=", "1")
.returning(asName("id")
.sql()
deleteFromOnly in interface DeleteFirstStepname - target table name