org.babyfish.jimmer.sql.runtime.AbstractExecutorProxy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-sql Show documentation
Show all versions of jimmer-sql Show documentation
A revolutionary ORM framework for both java and kotlin
The newest version!
package org.babyfish.jimmer.sql.runtime;
import org.babyfish.jimmer.meta.ImmutableProp;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Modifier;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
public abstract class AbstractExecutorProxy implements Executor {
protected final Executor raw;
protected AbstractExecutorProxy(Executor raw) {
this.raw = raw;
}
@Override
public final BatchContext executeBatch(
@NotNull Connection con,
@NotNull String sql,
@Nullable ImmutableProp generatedIdProp,
@NotNull ExecutionPurpose purpose,
@NotNull JSqlClientImplementor sqlClient
) {
return createBatch(
raw.executeBatch(
con,
sql,
generatedIdProp,
purpose,
sqlClient
)
);
}
protected abstract AbstractExecutorProxy recreate(Executor raw);
protected abstract Batch createBatch(BatchContext raw);
protected static abstract class Batch implements BatchContext {
protected final BatchContext raw;
protected Batch(BatchContext raw) {
this.raw = raw;
}
@Override
public JSqlClientImplementor sqlClient() {
return raw.sqlClient();
}
@Override
public String sql() {
return raw.sql();
}
@Override
public ExecutionPurpose purpose() {
return raw.purpose();
}
@Override
public ExecutorContext ctx() {
return raw.ctx();
}
@Override
public void add(List