mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#919 - io.ebean package initial
This commit is contained in:
1 parent
5821dc96b9
commit
971e2dc91b
2134 files changed
+10721
-8652
No files matched your search
@@ -0,0 +1,65 @@
|
||||
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.
|
||||
* <p>
|
||||
* Supports the use of PreparedStatement batching.
|
||||
* </p>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
public BatchControl createBatchControl(SpiTransaction t) {
|
||||
|
||||
// create a BatchControl and set its defaults
|
||||
return new BatchControl(t, defaultBatchSize, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the updateSqlRequest
|
||||
*/
|
||||
public int executeOrmUpdate(PersistRequestOrmUpdate request) {
|
||||
return exeOrmUpdate.execute(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the updateSqlRequest
|
||||
*/
|
||||
public int executeSqlUpdate(PersistRequestUpdateSql request) {
|
||||
return exeUpdateSql.execute(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the CallableSqlRequest.
|
||||
*/
|
||||
public int executeSqlCallable(PersistRequestCallableSql request) {
|
||||
return exeCallableSql.execute(request);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user