From 34550dd77809d096e695e26c2305604ee38e0f7a Mon Sep 17 00:00:00 2001 From: Robin Bygrave Date: Fri, 31 Jul 2015 21:24:05 +1200 Subject: [PATCH] No effective change - code cleanup - BeanIdList - removed unused methods --- .../avaje/ebeaninternal/api/BeanIdList.java | 59 ++----------------- .../server/query/CQueryEngine.java | 2 +- 2 files changed, 6 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/avaje/ebeaninternal/api/BeanIdList.java b/src/main/java/com/avaje/ebeaninternal/api/BeanIdList.java index 533f5d10a..c1de039bd 100644 --- a/src/main/java/com/avaje/ebeaninternal/api/BeanIdList.java +++ b/src/main/java/com/avaje/ebeaninternal/api/BeanIdList.java @@ -1,68 +1,19 @@ package com.avaje.ebeaninternal.api; import java.util.List; -import java.util.concurrent.FutureTask; -import java.util.concurrent.TimeUnit; - -import javax.persistence.PersistenceException; /** - * Wrapper of the list of Id's adding support for background fetching - * future object. - * - * @author rbygrave + * Wrapper of the list of Id's. */ public class BeanIdList { private final List idList; - - private boolean hasMore = true; - - private FutureTask fetchFuture; - + + private boolean hasMore; + public BeanIdList(List idList) { this.idList = idList; } - - /** - * Return true if the fetch is continuing in a background thread. - */ - public boolean isFetchingInBackground() { - return fetchFuture != null; - } - - /** - * Set the FutureTask that is continuing the fetch in a background thread. - */ - public void setBackgroundFetch(FutureTask fetchFuture) { - this.fetchFuture = fetchFuture; - } - - /** - * Wait for the background fetching to complete with a timeout. - */ - public void backgroundFetchWait(long wait, TimeUnit timeUnit) { - if (fetchFuture != null){ - try { - fetchFuture.get(wait, timeUnit); - } catch (Exception e) { - throw new PersistenceException(e); - } - } - } - - /** - * Wait for the background fetching to complete. - */ - public void backgroundFetchWait() { - if (fetchFuture != null){ - try { - fetchFuture.get(); - } catch (Exception e) { - throw new PersistenceException(e); - } - } - } /** * Add an Id to the list. @@ -91,5 +42,5 @@ public class BeanIdList { public void setHasMore(boolean hasMore) { this.hasMore = hasMore; } - + } diff --git a/src/main/java/com/avaje/ebeaninternal/server/query/CQueryEngine.java b/src/main/java/com/avaje/ebeaninternal/server/query/CQueryEngine.java index 90e819b6a..54ffa1938 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/query/CQueryEngine.java +++ b/src/main/java/com/avaje/ebeaninternal/server/query/CQueryEngine.java @@ -76,7 +76,7 @@ public class CQueryEngine { request.getTransaction().logSummary(rcQuery.getSummary()); } - if (!list.isFetchingInBackground() && request.getQuery().isFutureFetch()) { + if (request.getQuery().isFutureFetch()) { // end the transaction for futureFindIds (it had it's own one) logger.debug("Future findIds completed!"); request.getTransaction().end();