- All Superinterfaces:
Visitable
- All Known Subinterfaces:
ProcedureCall,ResultStatement,Statement.RegularQuery,Statement.SingleQuery,Statement.UnionQuery,Statement.UseStatement
Shall be the common interfaces for queries that we support.
For reference see: Cypher.
We have skipped the intermediate "Query" structure so a statement in the context of
this generator is either a Statement.RegularQuery or a StandaloneCall.
- Since:
- 1.0
- Author:
- Michael J. Simons
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresentsRegularQuery.static interfaceRepresents aSingleQuery.static interfaceRepresents aUnionQuery.static interfaceRepresents aUSEstatement, utilizing a composite graph call. -
Method Summary
Modifier and TypeMethodDescriptionstatic StatementBuilderbuilder()Returns a new statement builder.Returns an entry point into a statement that starts with a call to stored * procedure.default booleanReturns true if this statement can be assured to return something.Analyzes the statement and provides access to the resolved properties, their (potential) owners and the context in which they have been resolved.Returns the context of this statement, allowing access to parameter names etc.This method uses the default renderer to create a String representation of this statement.booleanSome constants may be rendered as parameters.static StatementCreates a statement based on a list ofclauses.voidsetRenderConstantsAsParameters(boolean renderConstantsAsParameters) Use this method to configure whether some constant values should be rendered as parameters or as literals before the first call toStatementCatalog.getParameters()orgetCypher().static StatementusingPeriodic(Integer batchSize, List<Clause> clauses) Creates a statement based on a list ofclausesand prepends it with USING PERIODIC COMMIT.
-
Method Details
-
builder
Returns a new statement builder.- Returns:
- a new statement builder
-
of
Creates a statement based on a list ofclauses. It is your task to provide a sanity check of the clauses. The builder will use the clauses "as is", neither change their order nor their type.- Parameters:
clauses- a list of clauses, must not be null- Returns:
- a statement
- Since:
- 2021.3.0
-
usingPeriodic
@API(status=STABLE, since="2021.3.0") static Statement usingPeriodic(Integer batchSize, List<Clause> clauses) Creates a statement based on a list ofclausesand prepends it with USING PERIODIC COMMIT. It is your task to provide a sanity check of the clauses. The builder will use the clauses "as is", neither change their order nor their type.The USING PERIODIC HINT is only valid right before the LOAD CSV clause.
- Parameters:
batchSize- the batch size to pass to PERIODIC COMMIT.clauses- a list of clauses, must not be null- Returns:
- a statement
- Since:
- 2021.3.0
-
call
Returns an entry point into a statement that starts with a call to stored * procedure.- Parameters:
namespaceAndProcedure- the fully qualified name of a stored procedure. Each part can be given as a separate String, but a fully qualified String is ok as well.- Returns:
- an entry point into a statement that starts with a call to stored procedure
-
getCatalog
StatementCatalog getCatalog()Analyzes the statement and provides access to the resolved properties, their (potential) owners and the context in which they have been resolved. Identifiable expressions may be retrieved viaStatementCatalog.getIdentifiableExpressions().- Returns:
- an immutable object representing properties resolved in a statement together with their context and owner
- Since:
- 2023.1.0
-
getCypher
String getCypher()This method uses the default renderer to create a String representation of this statement. The generated Cypher will use escaped literals and correct placeholders like$paramfor parameters. The placeholders for parameters can be retrieved viaStatementCatalog.getParameterNames(). Bounded values for parameters can be retrieved viaStatementCatalog.getParameters().This method is thread safe.
- Returns:
- a valid Cypher statement
- Since:
- 2021.0.0
-
getContext
Returns the context of this statement, allowing access to parameter names etc.- Returns:
- the context of this statement, allowing access to parameter names etc
-
isRenderConstantsAsParameters
boolean isRenderConstantsAsParameters()Some constants may be rendered as parameters.- Returns:
- true if literal parameters hav
-
setRenderConstantsAsParameters
void setRenderConstantsAsParameters(boolean renderConstantsAsParameters) Use this method to configure whether some constant values should be rendered as parameters or as literals before the first call toStatementCatalog.getParameters()orgetCypher().Renderers are free to chose to ignore this.
- Parameters:
renderConstantsAsParameters- set to true to render constants as parameters (when usinggetCypher().
-
doesReturnOrYield
default boolean doesReturnOrYield()Returns true if this statement can be assured to return something.- Returns:
- true if this statement can be assured to return something
-