Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15x] Remove "Future queries" findFutureList, findFutureIds, findFutureCount #3212

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions ebean-api/src/main/java/io/ebean/ExpressionList.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,42 +412,6 @@ default <A> A findSingleAttribute() {
*/
Optional<T> findOneOrEmpty();

/**
* Execute find row count query in a background thread.
* <p>
* This returns a Future object which can be used to cancel, check the
* execution status (isDone etc) and get the value (with or without a
* timeout).
* </p>
*
* @return a Future object for the row count query
*/
FutureRowCount<T> findFutureCount();

/**
* Execute find Id's query in a background thread.
* <p>
* This returns a Future object which can be used to cancel, check the
* execution status (isDone etc) and get the value (with or without a
* timeout).
* </p>
*
* @return a Future object for the list of Id's
*/
FutureIds<T> findFutureIds();

/**
* Execute find list query in a background thread.
* <p>
* This returns a Future object which can be used to cancel, check the
* execution status (isDone etc) and get the value (with or without a
* timeout).
* </p>
*
* @return a Future object for the list result of the query
*/
FutureList<T> findFutureList();

/**
* Return a PagedList for this query using firstRow and maxRows.
* <p>
Expand Down
20 changes: 0 additions & 20 deletions ebean-api/src/main/java/io/ebean/FutureIds.java

This file was deleted.

35 changes: 0 additions & 35 deletions ebean-api/src/main/java/io/ebean/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -1068,41 +1068,6 @@ enum LockWait {
*/
int findCount();

/**
* Execute find row count query in a background thread.
* <p>
* This returns a Future object which can be used to cancel, check the
* execution status (isDone etc) and get the value (with or without a
* timeout).
* </p>
*
* @return a Future object for the row count query
*/
FutureRowCount<T> findFutureCount();

/**
* Execute find Id's query in a background thread.
* <p>
* This returns a Future object which can be used to cancel, check the
* execution status (isDone etc) and get the value (with or without a
* timeout).
* </p>
*
* @return a Future object for the list of Id's
*/
FutureIds<T> findFutureIds();

/**
* Execute find list query in a background thread.
* <p>
* This query will execute in it's own PersistenceContext and using its own transaction.
* What that means is that it will not share any bean instances with other queries.
* </p>
*
* @return a Future object for the list result of the query
*/
FutureList<T> findFutureList();

/**
* Return a PagedList for this query using firstRow and maxRows.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,6 @@ public interface SpiEbeanServer extends SpiServer, ExtendedServer, BeanCollectio

<T> FutureRowCount<T> findFutureCount(SpiQuery<T> query);

<T> FutureIds<T> findFutureIds(SpiQuery<T> query);

<T> FutureList<T> findFutureList(SpiQuery<T> query);

<T> PagedList<T> findPagedList(SpiQuery<T> query);

<T> Set<T> findSet(SpiQuery<T> query);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1228,45 +1228,6 @@ public <T> FutureRowCount<T> findFutureCount(SpiQuery<T> query) {
return queryFuture;
}

@Override
public <T> FutureIds<T> findFutureIds(SpiQuery<T> query) {
SpiQuery<T> copy = query.copy();
boolean createdTransaction = false;
SpiTransaction transaction = query.transaction();
if (transaction == null) {
transaction = currentServerTransaction();
if (transaction == null) {
transaction = (SpiTransaction) createTransaction();
createdTransaction = true;
}
copy.usingTransaction(transaction);
}
QueryFutureIds<T> queryFuture = new QueryFutureIds<>(new CallableQueryIds<>(this, copy, createdTransaction));
backgroundExecutor.execute(queryFuture.futureTask());
return queryFuture;
}

@Override
public <T> FutureList<T> findFutureList(SpiQuery<T> query) {
SpiQuery<T> spiQuery = query.copy();
// FutureList query always run in it's own persistence content
spiQuery.setPersistenceContext(new DefaultPersistenceContext());
// Create a new transaction solely to execute the findList() at some future time
boolean createdTransaction = false;
SpiTransaction transaction = query.transaction();
if (transaction == null) {
transaction = currentServerTransaction();
if (transaction == null) {
transaction = (SpiTransaction) createTransaction();
createdTransaction = true;
}
spiQuery.usingTransaction(transaction);
}
QueryFutureList<T> queryFuture = new QueryFutureList<>(new CallableQueryList<>(this, spiQuery, createdTransaction));
backgroundExecutor.execute(queryFuture.futureTask());
return queryFuture;
}

@Override
public <T> PagedList<T> findPagedList(SpiQuery<T> query) {
int maxRows = query.getMaxRows();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,6 @@ public int update(Transaction transaction) {
return query.update(transaction);
}

@Override
public FutureIds<T> findFutureIds() {
return query.findFutureIds();
}

@Override
public FutureRowCount<T> findFutureCount() {
return query.findFutureCount();
}

@Override
public FutureList<T> findFutureList() {
return query.findFutureList();
}

@Override
public PagedList<T> findPagedList() {
return query.findPagedList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,6 @@ public ExpressionList<T> filterMany(String prop) {
return rootQuery.filterMany(prop);
}

@Override
public FutureIds<T> findFutureIds() {
return rootQuery.findFutureIds();
}

@Override
public FutureList<T> findFutureList() {
return rootQuery.findFutureList();
}

@Override
public FutureRowCount<T> findFutureCount() {
return rootQuery.findFutureCount();
}

@Override
public List<T> findList() {
return rootQuery.findList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,21 +328,6 @@ public boolean exists() {
return exprList.exists();
}

@Override
public FutureIds<T> findFutureIds() {
return exprList.findFutureIds();
}

@Override
public FutureList<T> findFutureList() {
return exprList.findFutureList();
}

@Override
public FutureRowCount<T> findFutureCount() {
return exprList.findFutureCount();
}

@Override
public <A> List<A> findIds() {
return exprList.findIds();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
import io.ebean.FetchConfig;
import io.ebean.FetchGroup;
import io.ebean.FetchPath;
import io.ebean.FutureIds;
import io.ebean.FutureList;
import io.ebean.FutureRowCount;
import io.ebean.OrderBy;
import io.ebean.PagedList;
import io.ebean.PersistenceContextScope;
Expand Down Expand Up @@ -346,21 +343,6 @@ public int findCount() {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}

@Override
public FutureRowCount<T> findFutureCount() {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}

@Override
public FutureIds<T> findFutureIds() {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}

@Override
public FutureList<T> findFutureList() {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}

@Override
public PagedList<T> findPagedList() {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
Expand Down

This file was deleted.

This file was deleted.

Loading