All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ebeaninternal.server.persist.DefaultPersistExecute Maven / Gradle / Ivy

There is a newer version: 15.8.1
Show newest version
package io.ebeaninternal.server.persist;

import io.ebeaninternal.api.SpiTransaction;
import io.ebeaninternal.server.core.PersistRequestCallableSql;
import io.ebeaninternal.server.core.PersistRequestOrmUpdate;
import io.ebeaninternal.server.core.PersistRequestUpdateSql;

/**
 * Default PersistExecute implementation using DML statements.
 * 

* Supports the use of PreparedStatement batching. *

*/ final class DefaultPersistExecute implements PersistExecute { private final ExeCallableSql exeCallableSql; private final ExeUpdateSql exeUpdateSql; private final ExeOrmUpdate exeOrmUpdate; /** * The default batch size. */ private final int defaultBatchSize; /** * Construct this DmlPersistExecute. */ DefaultPersistExecute(Binder binder, int defaultBatchSize) { this.exeOrmUpdate = new ExeOrmUpdate(binder); this.exeUpdateSql = new ExeUpdateSql(binder); this.exeCallableSql = new ExeCallableSql(binder); this.defaultBatchSize = defaultBatchSize; } @Override public BatchControl createBatchControl(SpiTransaction t) { // create a BatchControl and set its defaults return new BatchControl(t, defaultBatchSize, true); } /** * Execute the updateSqlRequest */ @Override public int executeOrmUpdate(PersistRequestOrmUpdate request) { return exeOrmUpdate.execute(request); } /** * Execute the updateSqlRequest */ @Override public int executeSqlUpdate(PersistRequestUpdateSql request) { return exeUpdateSql.execute(request); } /** * Execute the CallableSqlRequest. */ @Override public int executeSqlCallable(PersistRequestCallableSql request) { return exeCallableSql.execute(request); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy