mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-13 21:01:01 +08:00
Add CTE docs
This commit is contained in:
parent
907d97fb50
commit
aa98f38c52
@ -728,6 +728,27 @@ query.from(employee)
|
||||
]]></programlisting>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
|
||||
<title>Common table expressions</title>
|
||||
|
||||
<para>Common table expressions are supported in Querydsl SQL via two syntax variants</para>
|
||||
|
||||
<programlisting language="java"><![CDATA[
|
||||
query.with(employee, sq().from(employee).where(employee.name.startsWith("A")).list(employee.all()))
|
||||
.from(...)
|
||||
]]></programlisting>
|
||||
|
||||
<para>And using a column listing</para>
|
||||
|
||||
<programlisting language="java"><![CDATA[
|
||||
query.with(employee, employee.id, employee.name)
|
||||
.as(sq().from(employee).where(employee.name.startsWith("A")).list(employee.id, employee.name))
|
||||
.from(...)
|
||||
]]></programlisting>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
|
||||
|
||||
@ -290,6 +290,12 @@ public interface SQLCommonQuery<Q extends SQLCommonQuery<Q>> extends Query<Q> {
|
||||
/**
|
||||
* Adds a common table expression
|
||||
*
|
||||
* <p>Usage</p>
|
||||
* <pre>
|
||||
* query.with(alias, subQuery)
|
||||
* .from(...)
|
||||
* </pre>
|
||||
*
|
||||
* @param alias
|
||||
* @param o
|
||||
* @return
|
||||
@ -299,6 +305,12 @@ public interface SQLCommonQuery<Q extends SQLCommonQuery<Q>> extends Query<Q> {
|
||||
/**
|
||||
* Adds a common table expression
|
||||
*
|
||||
* <p>Usage</p>
|
||||
* <pre>
|
||||
* query.with(alias, subQuery)
|
||||
* .from(...)
|
||||
* </pre>
|
||||
*
|
||||
* @param alias
|
||||
* @param query
|
||||
* @return
|
||||
@ -308,6 +320,12 @@ public interface SQLCommonQuery<Q extends SQLCommonQuery<Q>> extends Query<Q> {
|
||||
/**
|
||||
* Adds a common table expression
|
||||
*
|
||||
* <p>Usage</p>
|
||||
* <pre>
|
||||
* query.with(alias, columns...).as(subQuery)
|
||||
* .from(...)
|
||||
* </pre>
|
||||
*
|
||||
* @param alias
|
||||
* @param columns
|
||||
* @return
|
||||
@ -317,6 +335,12 @@ public interface SQLCommonQuery<Q extends SQLCommonQuery<Q>> extends Query<Q> {
|
||||
/**
|
||||
* Adds a common table expression
|
||||
*
|
||||
* <p>Usage</p>
|
||||
* <pre>
|
||||
* query.withRecursive(alias, subQuery)
|
||||
* .from(...)
|
||||
* </pre>
|
||||
*
|
||||
* @param alias
|
||||
* @param o
|
||||
* @return
|
||||
@ -326,6 +350,12 @@ public interface SQLCommonQuery<Q extends SQLCommonQuery<Q>> extends Query<Q> {
|
||||
/**
|
||||
* Adds a common table expression
|
||||
*
|
||||
* <p>Usage</p>
|
||||
* <pre>
|
||||
* query.withRecursive(alias, subQuery)
|
||||
* .from(...)
|
||||
* </pre>
|
||||
*
|
||||
* @param alias
|
||||
* @param query
|
||||
* @return
|
||||
@ -335,6 +365,12 @@ public interface SQLCommonQuery<Q extends SQLCommonQuery<Q>> extends Query<Q> {
|
||||
/**
|
||||
* Adds a common table expression
|
||||
*
|
||||
* <p>Usage</p>
|
||||
* <pre>
|
||||
* query.withRecursive(alias, columns...).as(subQuery)
|
||||
* .from(...)
|
||||
* </pre>
|
||||
*
|
||||
* @param alias
|
||||
* @param columns
|
||||
* @return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user