Package org.apache.juneau.beanquery.sql
Class SqlBeanQuerySession.Builder<T>
java.lang.Object
org.apache.juneau.commons.beanquery.BeanQuerySession.Builder<T,SqlBeanQuerySession.Builder<T>>
org.apache.juneau.beanquery.sql.SqlBeanQuerySession.Builder<T>
- Type Parameters:
T- The row type.
- Enclosing class:
- SqlBeanQuerySession<T>
public static final class SqlBeanQuerySession.Builder<T>
extends BeanQuerySession.Builder<T,SqlBeanQuerySession.Builder<T>>
Builder for
SqlBeanQuerySession. See the class Javadoc for an example.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the session.connection(Connection value) Runs this session on a caller-owned connection instead of one from the context's connection source.guard(SqlFragment value) Sets a per-request SQL predicate, AND-ed (in parentheses) with the context guard into every statement.Methods inherited from class org.apache.juneau.commons.beanquery.BeanQuerySession.Builder
countPolicy, defaultLimit, maxExpressionDepth, maxLimit, maxSearchClauses, maxSearchLength, maxSortKeys, regexTimeout, restrictColumns, self
-
Method Details
-
connection
Runs this session on a caller-owned connection instead of one from the context's connection source. The session never closes it.- Parameters:
value- The connection. Must not benull .- Returns:
- This object.
-
guard
Sets a per-request SQL predicate, AND-ed (in parentheses) with the context guard into every statement.- Parameters:
value- The guard, ornull for none.- Returns:
- This object.
-
build
Builds the session.- Specified by:
buildin classBeanQuerySession.Builder<T,SqlBeanQuerySession.Builder<T>> - Returns:
- A new session. Close it when done.
- Throws:
BeanQueryExecutionException- If no connection was given and none can be obtained.
-