[jOOQ/jOOQ#15020] Replacer and Traverse should recurse into TableField's Table reference

This commit is contained in:
Lukas Eder 2023-05-04 18:14:00 +02:00
parent ce7508ea40
commit a29c8a2216
5 changed files with 86 additions and 18 deletions

View File

@ -301,19 +301,6 @@ implements

View File

@ -108,6 +108,7 @@ import org.jooq.GeneratorStatementType;
// ...
import org.jooq.QueryPart;
import org.jooq.RenderContext.CastMode;
// ...
import org.jooq.Row;
import org.jooq.SQLDialect;
import org.jooq.Select;
@ -505,10 +506,6 @@ extends

View File

@ -202,6 +202,7 @@ final class Names {
static final Name N_OBJECT_CONSTRUCT = systemName("object_construct");
static final Name N_OBJECT_CONSTRUCT_KEEP_NULL = systemName("object_construct_keep_null");
static final Name N_OFFSET = systemName("offset");
static final Name N_OPAQUE = systemName("opaque");
static final Name N_OPENJSON = systemName("openjson");
static final Name N_OPENXML = systemName("openxml");
static final Name N_ORDINAL = systemName("ordinal");

View File

@ -0,0 +1,65 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: https://www.jooq.org/legal/licensing
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq.impl;
import static org.jooq.impl.Names.N_OPAQUE;
import org.jooq.Context;
import org.jooq.FieldOrRowOrSelect;
import org.jooq.impl.QOM.UOpaque;
/**
* [#15020] A {@link UOpaque} field delegate that prevents recursing too many times
*
* @author Lukas Eder
*/
final class OpaqueFieldDelegate extends CustomField<Object> {
final FieldOrRowOrSelect delegate;
OpaqueFieldDelegate(FieldOrRowOrSelect delegate) {
super(N_OPAQUE, SQLDataType.OTHER);
this.delegate = delegate;
}
@Override
public final void accept(Context<?> ctx) {
ctx.visit(delegate);
}
}

View File

@ -86,7 +86,6 @@ extends
implements
TableField<R, T>,
SimpleQueryPart,
UNotYetImplemented,
TypedReference<T>,
ScopeMappable
{
@ -217,6 +216,25 @@ implements
// XXX: Query Object Model
// -------------------------------------------------------------------------
// ------------------------------------------------------------------------
// XXX: Object API
// ------------------------------------------------------------------------