Interface EntitySelectQuery.Builder.WithAsStep

Enclosing interface:
EntitySelectQuery.Builder

public static sealed interface EntitySelectQuery.Builder.WithAsStep
Adds a common table expression (CTE) to the query. CTEs are prepended to the query using the WITH clause.

Example:


 EntitySelectQuery.builder()
     .with("active_customers")
     .as("SELECT * FROM customer WHERE active = true")
     .from("active_customers")
     .columns("id, name")
     .build()
 
Generates:

 WITH active_customers AS (SELECT * FROM customer WHERE active = true)
 SELECT id, name
 FROM active_customers