mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
36 lines
762 B
Java
36 lines
762 B
Java
package io.ebeaninternal.server.query;
|
|
|
|
import io.ebean.FutureRowCount;
|
|
import io.ebean.Transaction;
|
|
|
|
import java.util.concurrent.FutureTask;
|
|
|
|
/**
|
|
* Future implementation for the row count query.
|
|
*/
|
|
public class QueryFutureRowCount<T> extends BaseFuture<Integer> implements FutureRowCount<T> {
|
|
|
|
private final CallableQueryCount<T> call;
|
|
|
|
public QueryFutureRowCount(CallableQueryCount<T> call) {
|
|
super(new FutureTask<>(call));
|
|
this.call = call;
|
|
}
|
|
|
|
public FutureTask<Integer> getFutureTask() {
|
|
return futureTask;
|
|
}
|
|
|
|
public Transaction getTransaction() {
|
|
return call.transaction;
|
|
}
|
|
|
|
@Override
|
|
public boolean cancel(boolean mayInterruptIfRunning) {
|
|
call.query.cancel();
|
|
return super.cancel(mayInterruptIfRunning);
|
|
}
|
|
|
|
|
|
}
|