001package com.avaje.ebean;
002
003import java.util.List;
004import java.util.concurrent.Future;
005
006/**
007 * FutureIds represents the result of a background query execution for the Id's.
008 * <p>
009 * It extends the java.util.concurrent.Future with the ability to get the Id's
010 * while the query is still executing in the background.
011 * </p>
012 * 
013 * @author rbygrave
014 */
015public interface FutureIds<T> extends Future<List<Object>> {
016
017  /**
018   * Returns the original query used to fetch the Id's.
019   */
020  Query<T> getQuery();
021
022  /**
023   * Return the list of Id's which could be partially populated.
024   * <p>
025   * That is the query getting the id's could still be running and adding id's
026   * to this list.
027   * </p>
028   * <p>
029   * To get the list of Id's ensuring the query has finished use the
030   * {@link Future#get()} method instead of this one.
031   * </p>
032   */
033  List<Object> getPartialIds();
034}