Class StatementContext.Builder<T>
java.lang.Object
com.pyranid.StatementContext.Builder<T>
- Enclosing class:
StatementContext<T>
Builder used to construct instances of
StatementContext.
This class is intended for use by a single thread.
A Statement captured from an execution can carry original binding names, which this builder inherits
when their count matches the supplied parameters. Names are not part of Statement equality, but
effective names are part of StatementContext equality. Equal statements can therefore produce unequal
contexts. Supply parameterNames(List) to choose the context's names explicitly.
- Since:
- 2.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a context with snapshots of the supplied parameters and effective binding names.parameterNames(@Nullable List<@Nullable String> parameterNames) Supplies expanded JDBC slot names for a manually built context.parameters(@Nullable Object @Nullable ... parameters) parameters(@Nullable List<@Nullable Object> parameters) resultSetRowType(@Nullable Class<T> resultSetRowType)
-
Method Details
-
parameters
-
parameters
-
parameterNames
public @NonNull StatementContext.Builder parameterNames(@Nullable List<@Nullable String> parameterNames) Supplies expanded JDBC slot names for a manually built context. The count must match the number of supplied parameters, and individual unknown names may benull. Names have no leading colon. Passingnullinherits compatible query metadata carried by the statement when present; incompatible or absent inherited names become unknown. An explicit list with an incompatible count causesbuild()to throwIllegalArgumentException. The list is copied when built.- Parameters:
parameterNames- expanded-slot names, ornullto inherit available metadata- Returns:
- this builder
- Since:
- 4.9.0
-
resultSetRowType
-
build
Builds a context with snapshots of the supplied parameters and effective binding names.- Returns:
- the new context
- Throws:
IllegalArgumentException- if an explicitly supplied non-null name list does not match the number of supplied parameters
-