001package io.ebeanservice.docstore.api;
002
003import io.ebean.text.json.JsonReadOptions;
004import io.ebeaninternal.api.SpiQuery;
005import io.ebeaninternal.api.SpiTransaction;
006
007/**
008 * A Query request for the document store.
009 */
010public interface DocQueryRequest<T> {
011
012  /**
013   * Return the transaction for this request (can be null for document store only queries).
014   */
015  SpiTransaction getTransaction();
016
017  /**
018   * Set the (document store) transaction to use for this query.
019   */
020  void setTransaction(SpiTransaction transaction);
021
022  /**
023   * Return the query for this request.
024   */
025  SpiQuery<T> getQuery();
026
027  /**
028   * Create JsonReadOptions taking into account persistence context and lazy loading support.
029   */
030  JsonReadOptions createJsonReadOptions();
031
032  /**
033   * Execute secondary queries.
034   */
035  void executeSecondaryQueries(boolean forEach);
036
037}