Package com.github.eikecochu.sqlbuilder
Class With
- java.lang.Object
-
- com.github.eikecochu.sqlbuilder.QueryPartImpl<With>
-
- com.github.eikecochu.sqlbuilder.With
-
- All Implemented Interfaces:
BeforeDelete<With>,BeforeInsert<With>,BeforeSelect<With>,BeforeUpdate<With>,BeforeWith<With>,QueryPart,QueryPartLinked<With>,QueryPartSQL<With>
public class With extends QueryPartImpl<With> implements BeforeWith<With>, BeforeSelect<With>, BeforeUpdate<With>, BeforeDelete<With>, BeforeInsert<With>
The WITH expression. Allows creating Common Table Expressions (CTE) to use in the following SELECT statement, for example for recursive queries.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWith(BeforeWith<?> parent, java.lang.String name)With(java.lang.String name)Create a new WITH statement
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Withas(QueryBuilder<?> builder)Use a subquery as the body of this WITH statementWithcolumn(java.lang.String column)Add a column to this WITH statementWithcolumns(java.lang.String... columns)Add multiple columns to this WITH statementWithrecursive()Flag WITH statement as RECURSIVEjava.lang.Stringstring(QueryOptions options)Transforms this statement into an SQL string-
Methods inherited from class com.github.eikecochu.sqlbuilder.QueryPartImpl
parent, sql
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.BeforeDelete
delete, delete, delete, deleteSQL
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.BeforeInsert
insert, insert, insert, insertSQL
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.BeforeSelect
select, select, select, selectSQL
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.BeforeUpdate
update, update, update, updateSQL
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.BeforeWith
with, with, withSQL
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPartLinked
ext, parent, parent
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPartSQL
sql
-
-
-
-
Constructor Detail
-
With
public With(java.lang.String name)
Create a new WITH statement- Parameters:
name- The name of the with-block
-
With
protected With(BeforeWith<?> parent, java.lang.String name)
-
-
Method Detail
-
recursive
public With recursive()
Flag WITH statement as RECURSIVE- Returns:
- This WITH statement
-
column
public With column(java.lang.String column)
Add a column to this WITH statement- Parameters:
column- The column name to add- Returns:
- This WITH statement
-
columns
public With columns(java.lang.String... columns)
Add multiple columns to this WITH statement- Parameters:
columns- The column names to add- Returns:
- This WITH statement
-
as
public With as(QueryBuilder<?> builder)
Use a subquery as the body of this WITH statement- Parameters:
builder- The subquery builder to use as body- Returns:
- This WITH statement
-
string
public java.lang.String string(QueryOptions options)
Description copied from interface:QueryPartTransforms this statement into an SQL string
-
-