Interface SQLStatement
- All Known Subinterfaces:
ComparisonStatement,ExpressionStatement
- All Known Implementing Classes:
BindExpressionStatement,BooleanAndStatement,BooleanNotStatement,BooleanOrStatement,ColumnExpressionStatement,ComparisonOperatorStatement,FromStatement,IsNotNullComparisonStatement,IsNullComparisonStatement,LiteralExpressionStatement,OrderByStatement,SelectStatement,WhereStatement
public interface SQLStatement
Core interface for all SQL statement components.
This interface defines the contract for objects that represent SQL statements
or parts of statements within the compositional SQL building hierarchy.
Implementing classes represent specific SQL constructs (SELECT, WHERE,
FROM, JOIN, etc.).
DatabaseSchemaLayout layout = new DatabaseSchemaLayout(driver, getHSQLDataSource())
Table table = layout.getCurrentSchema().getTable("customer");
SQLStatement select = new SelectStatement(layout)
.column(table.getColumn("name"))
.column(table.getColumn("zip"))
.from(table,"c")
.where()
.equals(table.getColumn("bridge"), bridgeId)
.and()
.greaterThan(table.getColumn("bridgeHeight"), 6)
.end()
.done();
- Author:
- jbanes
-
Method Summary
Modifier and TypeMethodDescriptiondefault SQLStatementIf this statement is part of a larger statement, this returns the parent statement.default com.invirgance.convirgance.dbms.Queryquery()Obtain aQueryobject for executiondefault com.invirgance.convirgance.dbms.Queryquery(SQLRenderer renderer) Obtain aQueryobject for executionrender(SQLRenderer renderer) default voidsetParent(SQLStatement parent)
-
Method Details
-
getParent
If this statement is part of a larger statement, this returns the parent statement.- Returns:
- the parent statement
-
setParent
-
query
default com.invirgance.convirgance.dbms.Query query()Obtain aQueryobject for execution- Returns:
- a Query object
-
query
Obtain aQueryobject for execution- Parameters:
renderer- the SQL renderer to use when creating the query- Returns:
- a Query object
-
render
-