MCPcopy Create free account
hub / github.com/jOOQ/jOOQ / transformNestedTypes

Method transformNestedTypes

jOOQ/src/main/java/org/jooq/impl/Multiset.java:685–720  ·  view source on GitHub ↗
(
        Field<?> field,
        Function<? super UDTDataType<?>, ? extends Field<?>> arrayOfUDT,
        Supplier<? extends Field<?>> arrayOfFormatted,
        Supplier<? extends Field<?>> arrayOfUnformatted,
        BiFunction<? super UDTDataType<?>, ? super UDTPathField<?, ?, ?>, ? extends Field<?>> udt
    )

Source from the content-addressed store, hash-verified

683 }
684
685 private static final Field<?> transformNestedTypes(
686 Field<?> field,
687 Function<? super UDTDataType<?>, ? extends Field<?>> arrayOfUDT,
688 Supplier<? extends Field<?>> arrayOfFormatted,
689 Supplier<? extends Field<?>> arrayOfUnformatted,
690 BiFunction<? super UDTDataType<?>, ? super UDTPathField<?, ?, ?>, ? extends Field<?>> udt
691 ) {
692 DataType<?> t = field.getDataType();
693
694 if (t.isArray()) {
695 DataType<?> ct = t.getArrayComponentDataType();
696
697 // [#19067] This currently applies to arrays of UDTs only. Let's not complicate things for ordinary arrays.
698 if (ConvertedDataType.delegate(ct) instanceof UDTDataType<?> ut)
699 return arrayOfUDT.apply(ut);
700 else if (ct.getBinding().formatter() != null)
701 return arrayOfFormatted.get();
702 else
703 return arrayOfUnformatted.get();
704 }
705 else if (ConvertedDataType.delegate(t) instanceof UDTDataType<?> ut) {
706 UDTPathField<?, ?, ?> up;
707
708 if (field instanceof UDTPathField<?, ?, ?> u)
709 up = u;
710 else if (field instanceof TableField<?, ?> tf)
711 up = new UDTPathFieldImpl<>(field.getUnqualifiedName(), t, tf.getTable(), ut.udt, null);
712 else
713 up = null;
714
715 if (up != null)
716 return udt.apply(ut, up);
717 }
718
719 return field;
720 }
721
722 private static final JSONArrayAggOrderByStep<?> jsonxArrayAgg(Context<?> ctx, Field<?> field) {
723 switch (emulateMultiset(ctx.configuration())) {

Callers 2

toJSONArraysMethod · 0.95
toXMLElementsMethod · 0.95

Calls 10

delegateMethod · 0.95
getDataTypeMethod · 0.65
isArrayMethod · 0.65
applyMethod · 0.65
formatterMethod · 0.65
getBindingMethod · 0.65
getMethod · 0.65
getUnqualifiedNameMethod · 0.65
getTableMethod · 0.65

Tested by

no test coverage detected