[#1639] Deprecate org.jooq.Adapter

This commit is contained in:
Lukas Eder 2012-07-27 20:26:54 +02:00
parent 616056c40e
commit 50838fed0a
9 changed files with 15 additions and 21 deletions

View File

@ -52,8 +52,6 @@ import org.jooq.ArrayRecord;
import org.jooq.DAO;
import org.jooq.DataType;
import org.jooq.Field;
import org.jooq.QueryPart;
import org.jooq.QueryPartInternal;
import org.jooq.Record;
import org.jooq.Result;
import org.jooq.SQLDialect;
@ -691,10 +689,6 @@ public abstract class BaseTest<
return delegate.getDialect();
}
protected final QueryPartInternal internal(QueryPart q) {
return delegate.internal(q);
}
protected final void sleep(long millis) {
try {
Thread.sleep(millis);

View File

@ -62,8 +62,6 @@ import org.jooq.DAO;
import org.jooq.DataType;
import org.jooq.ExecuteType;
import org.jooq.Field;
import org.jooq.QueryPart;
import org.jooq.QueryPartInternal;
import org.jooq.Record;
import org.jooq.Result;
import org.jooq.SQLDialect;
@ -718,10 +716,6 @@ public abstract class jOOQAbstractTest<
return create().getDialect();
}
protected final QueryPartInternal internal(QueryPart q) {
return q.internalAPI(QueryPartInternal.class);
}
protected String getSchemaSuffix() {
return "";
}

View File

@ -41,7 +41,10 @@ package org.jooq;
* This interface is for JOOQ INTERNAL USE only. Do not reference directly
*
* @author Lukas Eder
* @deprecated - 2.5.0 [#1639] - This part of the internal API will be removed
* in the near future. Do not reuse.
*/
@Deprecated
public interface Adapter {
/**
@ -60,6 +63,9 @@ public interface Adapter {
* @return This object wrapped by or cast to an internal type
* @throws ClassCastException If this object cannot be wrapped by or cast to
* the given internal type
* @deprecated - 2.5.0 [#1639] - This part of the internal API will be
* removed in the near future. Do not reuse.
*/
@Deprecated
<I> I internalAPI(Class<I> internalType) throws ClassCastException;
}

View File

@ -56,6 +56,7 @@ import java.sql.Connection;
*
* @author Lukas Eder
*/
@SuppressWarnings("deprecation")
public interface Attachable extends Adapter, Serializable {
/**

View File

@ -39,22 +39,21 @@ package org.jooq;
* The common base type for all objects that can be used for query composition.
* <p>
* All <code>QueryPart</code> implementations can be cast to
* {@link QueryPartInternal} in order to access the internal API. See also
* {@link #internalAPI(Class)}
* {@link QueryPartInternal} in order to access the internal API.
* <p>
* A <code>QueryPart</code> essentially combines the {@link Attachable}
* interface with SQL code generation and variable binding functionality.
* <p>
* Note that with jOOQ 3.0, <code>QueryPart</code> will no longer implement
* {@link Attachable}.
*
*
* @author Lukas Eder
*/
public interface QueryPart extends Attachable {
/**
* Attach this object to a new {@link Configuration}
*
*
* @deprecated - 2.5.0 [#1544] - The Attachable type will no longer be part
* of the QueryPart hierarchy. Please do not attach any
* <code>QueryPart</code> objects anymore, except for

View File

@ -94,7 +94,7 @@ abstract class AbstractBindContext extends AbstractContext<BindContext> implemen
@Override
public final BindContext bind(QueryPart part) {
if (part != null) {
QueryPartInternal internal = part.internalAPI(QueryPartInternal.class);
QueryPartInternal internal = (QueryPartInternal) part;
// If this is supposed to be a declaration section and the part isn't
// able to declare anything, then disable declaration temporarily

View File

@ -103,7 +103,7 @@ class BatchStore implements Batch {
work.setExecuteLogging(false);
for (int i = 0; i < records.length; i++) {
Configuration previous = records[i].internalAPI(AttachableInternal.class).getConfiguration();
Configuration previous = ((AttachableInternal) records[i]).getConfiguration();
try {
records[i].attach(create);
@ -175,7 +175,7 @@ class BatchStore implements Batch {
work.setExecuteListeners(Arrays.asList(QueryCollector.class.getName()));
for (int i = 0; i < records.length; i++) {
Configuration previous = records[i].internalAPI(AttachableInternal.class).getConfiguration();
Configuration previous = ((AttachableInternal) records[i]).getConfiguration();
try {
records[i].attach(create);

View File

@ -284,7 +284,7 @@ class DefaultRenderContext extends AbstractContext<RenderContext> implements Ren
@Override
public final RenderContext sql(QueryPart part) {
if (part != null) {
QueryPartInternal internal = part.internalAPI(QueryPartInternal.class);
QueryPartInternal internal = (QueryPartInternal) part;
// If this is supposed to be a declaration section and the part isn't
// able to declare anything, then disable declaration temporarily

View File

@ -116,7 +116,7 @@ class InsertImpl<R extends Record>
@Override
public final Insert<R> select(Select<?> select) {
Configuration configuration = getDelegate().internalAPI(AttachableInternal.class).getConfiguration();
Configuration configuration = ((AttachableInternal) getDelegate()).getConfiguration();
return new InsertSelectQueryImpl<R>(configuration, into, fields, select);
}