Package org.jdbi.v3.core.statement
Class ParsedSql
java.lang.Object
org.jdbi.v3.core.statement.ParsedSql
The SQL and parameters parsed from an SQL statement.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Fluent builder for ParsedSql instances. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParsedSql.Builder
builder()
Creates a new ParsedSql builder.boolean
The set of parameters parsed from the input SQL string.getSql()
Returns a SQL string suitable for use with a JDBCPreparedStatement
.int
hashCode()
static ParsedSql
of
(String sql, ParsedParameters parameters) A static factory ofParsedSql
instances.toString()
-
Method Details
-
getSql
Returns a SQL string suitable for use with a JDBCPreparedStatement
.- Returns:
- a SQL string suitable for use with a JDBC
PreparedStatement
.
-
getParameters
The set of parameters parsed from the input SQL string.- Returns:
- the set of parameters parsed from the input SQL string.
-
equals
-
hashCode
public int hashCode() -
toString
-
of
A static factory ofParsedSql
instances. The statement may contain only positional parameters (the "?" character). If your SQL code contains named parameters (for example variables preceded by a colon) then you have to replace them with positional parameters and specify the mapping in theParsedParameters
. You cannot mix named and positional parameters in one SQL statement.- Parameters:
sql
- the SQL code containing only positional parametersparameters
- the ordered list of named parameters, or positional parameters- Returns:
- New
ParsedSql
instance - See Also:
-
builder
Creates a new ParsedSql builder.- Returns:
- a builder instance.
-