42 /** |
42 /** |
43 * Register an out parameter identified by the given id. |
43 * Register an out parameter identified by the given id. |
44 * |
44 * |
45 * @param id the parameter identifier |
45 * @param id the parameter identifier |
46 * @param type the SQL type of the value of the parameter |
46 * @param type the SQL type of the value of the parameter |
47 * @return this {@link OutOperation} |
47 * @return this {@code OutOperation} |
48 * @throws IllegalArgumentException if id is not a parameter marker in the SQL |
48 * @throws IllegalArgumentException if id is not a parameter marker in the SQL |
49 * @throws IllegalStateException if this method has been called previously on |
49 * @throws IllegalStateException if this method has been called previously on |
50 * this {@link Operation} with the same id or this {@link OutOperation} has been submitted |
50 * this {@link Operation} with the same id or this {@code OutOperation} has been submitted |
51 */ |
51 */ |
52 public OutOperation<T> outParameter(String id, SqlType type); |
52 public OutOperation<T> outParameter(String id, SqlType type); |
53 |
53 |
54 /** |
54 /** |
55 * Provide a processor that will handle the result of executing the SQL. |
55 * Provide a processor that will handle the result of executing the SQL. |
56 * |
56 * |
57 * @param processor the {@link Function} that will be called to process the result of |
57 * @param processor the {@link Function} that will be called to process the result of |
58 * this {@link OutOperation} |
58 * this {@code OutOperation} |
59 * @return this {@link OutOperation} |
59 * @return this {@code OutOperation} |
60 * @throws IllegalStateException if this method has been called previously on |
60 * @throws IllegalStateException if this method has been called previously on |
61 * this {@link Operation} or this {@link Operation} has been submitted. |
61 * this {@link Operation} or this {@link Operation} has been submitted. |
62 */ |
62 */ |
63 public OutOperation<T> apply(Function<Result.OutColumn, ? extends T> processor); |
63 public OutOperation<T> apply(Function<Result.OutColumn, ? extends T> processor); |
64 |
64 |
65 // Covariant overrides |
65 // Covariant overrides |
66 |
66 |
|
67 /** |
|
68 * {@inheritDoc} |
|
69 * |
|
70 * @return this {@code OutOperation} |
|
71 */ |
67 @Override |
72 @Override |
68 public OutOperation<T> onError(Consumer<Throwable> handler); |
73 public OutOperation<T> onError(Consumer<Throwable> handler); |
69 |
74 |
|
75 /** |
|
76 * {@inheritDoc} |
|
77 * |
|
78 * @return this {@code OutOperation} |
|
79 */ |
70 @Override |
80 @Override |
71 public OutOperation<T> set(String id, Object value); |
81 public OutOperation<T> set(String id, Object value); |
72 |
82 |
|
83 /** |
|
84 * {@inheritDoc} |
|
85 * |
|
86 * @return this {@code OutOperation} |
|
87 */ |
73 @Override |
88 @Override |
74 public OutOperation<T> set(String id, Object value, SqlType type); |
89 public OutOperation<T> set(String id, Object value, SqlType type); |
75 |
90 |
|
91 /** |
|
92 * {@inheritDoc} |
|
93 * |
|
94 * @return this {@code OutOperation} |
|
95 */ |
76 @Override |
96 @Override |
77 public OutOperation<T> set(String id, CompletionStage<?> source); |
97 public OutOperation<T> set(String id, CompletionStage<?> source); |
78 |
98 |
|
99 /** |
|
100 * {@inheritDoc} |
|
101 * |
|
102 * @return this {@code OutOperation} |
|
103 */ |
79 @Override |
104 @Override |
80 public OutOperation<T> set(String id, CompletionStage<?> source, SqlType type); |
105 public OutOperation<T> set(String id, CompletionStage<?> source, SqlType type); |
81 |
106 |
|
107 /** |
|
108 * {@inheritDoc} |
|
109 * |
|
110 * @return this {@code OutOperation} |
|
111 */ |
82 @Override |
112 @Override |
83 public OutOperation<T> timeout(Duration minTime); |
113 public OutOperation<T> timeout(Duration minTime); |
84 |
114 |
85 } |
115 } |