org.jooq.QueryPartInternal Maven / Gradle / Ivy
/*
* 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
*
* http://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
* Apache-2.0 license and offer limited warranties, support, maintenance, and
* commercial database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;
import org.jooq.exception.DataAccessException;
import org.jetbrains.annotations.ApiStatus.Internal;
/**
* Base functionality declaration for all query objects
*
* This interface is for JOOQ INTERNAL USE only. Do not reference directly
*
* @author Lukas Eder
*/
@Internal
public interface QueryPartInternal extends QueryPart {
/**
* Whether a call to {@link #accept(Context)} would render content.
*
* @deprecated - Calling {@link #rendersContent(Context)} directly on a
* {@link QueryPart} is almost always a mistake.
*/
@Deprecated
boolean rendersContent(Context> ctx);
/**
* This {@link QueryPart} can accept
a {@link Context} object
* in order to render a SQL string or to bind its variables.
*
* @deprecated - Calling {@link #accept(Context)} directly on a
* {@link QueryPart} is almost always a mistake. Instead,
* {@link Context#visit(QueryPart)} should be called.
*/
@Deprecated
void accept(Context> ctx);
/**
* The {@link Clause}s that are represented by this query part.
*
* {@link QueryPart}s can specify several Clause
s for which an
* event will be emitted {@link Context#start(Clause) before} (in forward
* order) and {@link Context#end(Clause) after} (in reverse order) visiting
* the the query part through {@link Context#visit(QueryPart)}
*
* This method is for JOOQ INTERNAL USE only. Do not reference directly
*
* @return The Clause
s represented by this query part or
* null
or an empty array if this query part does not
* represent a clause.
*/
@SuppressWarnings("javadoc")
Clause[] clauses(Context> ctx);
/**
* Check whether this {@link QueryPart} is able to declare fields in a
* SELECT
clause.
*
* This method can be used by any {@link Context} to check how a certain SQL
* clause should be rendered.
*
* This method is for JOOQ INTERNAL USE only. Do not reference directly
*/
boolean declaresFields();
/**
* Check whether this {@link QueryPart} is able to declare tables in a
* FROM
clause or JOIN
clause.
*
* This method can be used by any {@link Context} to check how a certain SQL
* clause should be rendered.
*
* This method is for JOOQ INTERNAL USE only. Do not reference directly
*/
boolean declaresTables();
/**
* Check whether this {@link QueryPart} is able to declare windows in a
* WINDOW
clause.
*
* This method can be used by any {@link Context} to check how a certain SQL
* clause should be rendered.
*
* This method is for JOOQ INTERNAL USE only. Do not reference directly
*/
boolean declaresWindows();
/**
* Check whether this {@link QueryPart} is able to declare common table
* expressions in a WITH
clause.
*
* This method can be used by any {@link Context} to check how a certain SQL
* clause should be rendered.
*
* This method is for JOOQ INTERNAL USE only. Do not reference directly
*/
boolean declaresCTE();
/**
* Check whether this {@link QueryPart} is able to generate
* CAST
expressions around bind variables.
*
* This method can be used by any {@link Context} to check how a certain SQL
* clause should be rendered.
*
* This method is for JOOQ INTERNAL USE only. Do not reference directly
*/
boolean generatesCast();
}