MCPcopy Index your code
hub / github.com/jOOQ/jOOQ / accept0

Method accept0

jOOQ/src/main/java/org/jooq/impl/JSONArray.java:169–346  ·  view source on GitHub ↗
(Context<?> ctx)

Source from the content-addressed store, hash-verified

167 }
168
169 final void accept0(Context<?> ctx) {
170 QueryPartCollectionView<Field<?>> mapped = QueryPartCollectionView.wrap((Collection<Field<?>>) fields).map(JSONEntryImpl.jsonCastMapper(ctx));
171
172 switch (ctx.family()) {
173
174
175 case POSTGRES:
176 case YUGABYTEDB:
177 if (onNull == JSONOnNull.ABSENT_ON_NULL && !mapped.isEmpty()) {
178 Row1[] rows = map(fields, f -> row(f), Row1[]::new);
179 Table<?> t = values(rows).as("t", "a");
180 Field<?> a = t.field("a");
181 ctx.visit(DSL.field(
182 select((Field<?>) (getDataType() == JSON ? jsonArrayAgg(a) : jsonbArrayAgg(a)))
183 .from(t)
184 .where(a.isNotNull())
185 ));
186 }
187 else
188 ctx.visit(getDataType() == JSON ? N_JSON_BUILD_ARRAY : N_JSONB_BUILD_ARRAY).sql('(').visit(mapped).sql(')');
189
190 break;
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

Callers 1

acceptMethod · 0.95

Calls 15

wrapMethod · 0.95
jsonCastMapperMethod · 0.95
fieldMethod · 0.95
jsonCastMethod · 0.95
acceptStandardMethod · 0.95
absentOnNullIfMethod · 0.95
arrayMethod · 0.95
coalesceMethod · 0.95
$onNullMethod · 0.95
jsonbArrayAggMethod · 0.80
jsonTableMethod · 0.80
inlineMethod · 0.80

Tested by

no test coverage detected