Package org.apache.juneau.beanquery.sql
Class SqlFragment
java.lang.Object
org.apache.juneau.beanquery.sql.SqlFragment
A parameterized SQL predicate fragment: a boolean SQL expression plus the ordered bind values its
?
placeholders consume.
A SearchSqlRenderer for a custom operator returns one of these; the SQL context splices the sql()
into the assembled WHERE clause and appends the binds() to the prepared-statement parameter list in
order. Values are always bound as parameters (never string-concatenated) so a custom operator cannot open an
injection hole.
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbinds()The bind values in placeholder order.static SqlFragmentCreates a fragment from a varargs bind list.static SqlFragmentCreates a fragment.sql()The boolean SQL expression.toString()
-
Method Details
-
of
Creates a fragment.- Parameters:
sql- The boolean SQL expression, with?placeholders for each bind value. Must not benull or blank.binds- The bind values, in placeholder order. May be empty; must not benull .- Returns:
- A new fragment.
-
of
Creates a fragment from a varargs bind list.- Parameters:
sql- The boolean SQL expression, with?placeholders for each bind value. Must not benull or blank.binds- The bind values, in placeholder order.- Returns:
- A new fragment.
-
sql
The boolean SQL expression.- Returns:
- The SQL, never
null or blank.
-
binds
The bind values in placeholder order.- Returns:
- An unmodifiable list of bind values, never
null .
-
toString
-