JavaScript is disabled on your browser.
play.db.ebean

Class Model.Finder<I,T>

  • Enclosing class:
    Model


    public static class Model.Finder<I,T>
    extends java.lang.Object
    Helper for Ebean queries.
    See Also:
    Ebean API documentation
    • Constructor Summary

      Constructors
      Constructor and Description
      Model.Finder (java.lang.Class<I> idType, java.lang.Class<T> type)
      Creates a finder for entity of type T with ID of type I.
      Model.Finder (java.lang.String serverName, java.lang.Class<I> idType, java.lang.Class<T> type)
      Creates a finder for entity of type T with ID of type I, using a specific Ebean server.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      java.util.List<T> all ()
      Retrieves all entities of the given type.
      T byId (I id)
      Retrieves an entity by ID.
      void cancel ()
      Cancels query execution, if supported by the underlying database and driver.
      copy ()
      Copies this query.
      fetch (java.lang.String path)
      Specifies a path to load including all its properties.
      fetch (java.lang.String path, FetchConfig joinConfig)
      Additionally specifies a JoinConfig to specify a 'query join' and/or define the lazy loading query.
      fetch (java.lang.String path, java.lang.String fetchProperties)
      Specifies a path to fetch with a specific list properties to include, to load a partial object.
      fetch (java.lang.String assocProperty, java.lang.String fetchProperties, FetchConfig fetchConfig)
      Additionally specifies a FetchConfig to use a separate query or lazy loading to load this path.
      filter ()
      Creates a filter for sorting and filtering lists of entities locally without going back to the database.
      filterMany (java.lang.String propertyName)
      Applies a filter on the 'many' property list rather than the root level objects.
      findFutureIds ()
      Executes a find IDs query in a background thread.
      findFutureList ()
      Executes a find list query in a background thread.
      findFutureRowCount ()
      Executes a find row count query in a background thread.
      java.util.List<java.lang.Object> findIds ()
      Executes a query and returns the results as a list of IDs.
      findIterate ()
      java.util.List<T> findList ()
      Executes the query and returns the results as a list of objects.
      java.util.Map<?,T> findMap ()
      Executes the query and returns the results as a map of objects.
      <K> java.util.Map<K,T> findMap (java.lang.String a, java.lang.Class<K> b)
      Executes the query and returns the results as a map of the objects.
      findPagingList (int pageSize)
      Returns a PagingList for this query.
      int findRowCount ()
      Returns the number of entities this query should return.
      java.util.Set<T> findSet ()
      Executes the query and returns the results as a set of objects.
      T findUnique ()
      Executes the query and returns the results as either a single bean or null, if no matching bean is found.
      void findVisit ( visitor)
      ExpressionFactory getExpressionFactory ()
      Returns the ExpressionFactory used by this query.
      int getFirstRow ()
      Returns the first row value.
      java.lang.String getGeneratedSql ()
      Returns the SQL that was generated for executing this query.
      int getMaxRows ()
      Returns the maximum of rows for this query.
      RawSql getRawSql ()
      Returns the RawSql that was set to use for this query.
      int getTotalHits ()
      Return the total hits matched for a lucene text search query.
      UseIndex getUseIndex ()
      having ()
      Returns the query's having clause.
      having (com.avaje.ebean.Expression addExpressionToHaving)
      Adds an expression to the having clause and returns the query.
      having (java.lang.String addToHavingClause)
      Adds clauses to the having clause and returns the query.
      boolean isAutofetchTuned ()
      Returns true if this query was tuned by autoFetch.
      boolean isForUpdate ()
      Whether this query is for update
      I nextId ()
      Returns the next identity value.
      Model.Finder<I,T> on (java.lang.String server)
      Changes the Ebean server.
      order ()
      Returns the order by clause so that you can append an ascending or descending property to the order by clause.
      order (java.lang.String orderByClause)
      Sets the order by clause, replacing the existing order by clause if there is one.
      orderBy ()
      Returns the order by clause so that you can append an ascending or descending property to the order by clause.
      orderBy (java.lang.String orderByClause)
      Set the order by clause replacing the existing order by clause if there is one.
      query ()
      Creates a query.
      T ref (I id)
      Retrieves an entity reference for this ID.
      select (java.lang.String fetchProperties)
      Explicitly sets a comma delimited list of the properties to fetch on the 'main' entity bean, to load a partial object.
      setAutofetch (boolean autofetch)
      Explicitly specifies whether to use 'Autofetch' for this query.
      setBackgroundFetchAfter (int backgroundFetchAfter)
      Sets the rows after which fetching should continue in a background thread.
      setBufferFetchSizeHint (int fetchSize)
      Sets a hint, which for JDBC translates to Statement.fetchSize().
      setDistinct (boolean isDistinct)
      Sets whether this query uses DISTINCT.
      setFirstRow (int firstRow)
      Sets the first row to return for this query.
      setForUpdate (boolean forUpdate)
      Execute the select with "for update" which should lock the record "on read"
      setId (java.lang.Object id)
      Sets the ID value to query.
      setListener ( queryListener)
      Sets a listener to process the query on a row-by-row basis.
      setLoadBeanCache (boolean loadBeanCache)
      When set to true, all the beans from this query are loaded into the bean cache.
      setMapKey (java.lang.String mapKey)
      Sets the property to use as keys for a map.
      setMaxRows (int maxRows)
      Sets the maximum number of rows to return in the query.
      setOrder ( orderBy)
      Replaces any existing order by clause using an OrderBy object.
      setOrderBy ( orderBy)
      Set an OrderBy object to replace any existing order by clause.
      setParameter (int position, java.lang.Object value)
      Sets an ordered bind parameter according to its position.
      setParameter (java.lang.String name, java.lang.Object value)
      Sets a named bind parameter.
      setQuery (java.lang.String oql)
      Sets the OQL query to run
      setRawSql (RawSql rawSql)
      Sets RawSql to use for this query.
      setReadOnly (boolean readOnly)
      Sets whether the returned beans will be read-only.
      setTimeout (int secs)
      Sets a timeout on this query.
      setUseCache (boolean useBeanCache)
      Sets whether to use the bean cache.
      setUseIndex (UseIndex useIndex)
      setUseQueryCache (boolean useQueryCache)
      Sets whether to use the query cache.
      setVanillaMode (boolean vanillaMode)
      Sets whether to use 'vanilla mode', in which the returned beans and collections will be plain classes rather than Ebean-generated dynamic subclasses etc.
      where ()
      Adds expressions to the where clause with the ability to chain on the ExpressionList.
      where (com.avaje.ebean.Expression expression)
      Adds a single Expression to the where clause and returns the query.
      where (java.lang.String addToWhereClause)
      Adds additional clauses to the where clause.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Model.Finder

        public Model.Finder(java.lang.Class<I> idType,
         java.lang.Class<T> type)
        Creates a finder for entity of type T with ID of type I.
      • Model.Finder

        public Model.Finder(java.lang.String serverName,
         java.lang.Class<I> idType,
         java.lang.Class<T> type)
        Creates a finder for entity of type T with ID of type I, using a specific Ebean server.
    • Method Detail

      • on

        public Model.Finder<I,T> on(java.lang.String server)
        Changes the Ebean server.
      • all

        public java.util.List<T> all()
        Retrieves all entities of the given type.
      • byId

        public T byId(I id)
        Retrieves an entity by ID.
      • ref

        public T ref(I id)
        Retrieves an entity reference for this ID.
      • filter

        public  filter()
        Creates a filter for sorting and filtering lists of entities locally without going back to the database.
      • query

        public  query()
        Creates a query.
      • nextId

        public I nextId()
        Returns the next identity value.
      • cancel

        public void cancel()
        Cancels query execution, if supported by the underlying database and driver.
      • copy

        public  copy()
        Copies this query.
      • fetch

        public  fetch(java.lang.String path)
        Specifies a path to load including all its properties.
      • fetch

        public  fetch(java.lang.String path,
         FetchConfig joinConfig)
        Additionally specifies a JoinConfig to specify a 'query join' and/or define the lazy loading query.
      • fetch

        public  fetch(java.lang.String path,
         java.lang.String fetchProperties)
        Specifies a path to fetch with a specific list properties to include, to load a partial object.
      • fetch

        public  fetch(java.lang.String assocProperty,
         java.lang.String fetchProperties,
         FetchConfig fetchConfig)
        Additionally specifies a FetchConfig to use a separate query or lazy loading to load this path.
      • filterMany

        public  filterMany(java.lang.String propertyName)
        Applies a filter on the 'many' property list rather than the root level objects.
      • findFutureIds

        public  findFutureIds()
        Executes a find IDs query in a background thread.
      • findFutureList

        public  findFutureList()
        Executes a find list query in a background thread.
      • findFutureRowCount

        public  findFutureRowCount()
        Executes a find row count query in a background thread.
      • findIds

        public java.util.List<java.lang.Object> findIds()
        Executes a query and returns the results as a list of IDs.
      • findList

        public java.util.List<T> findList()
        Executes the query and returns the results as a list of objects.
      • findMap

        public java.util.Map<?,T> findMap()
        Executes the query and returns the results as a map of objects.
      • findMap

        public <K> java.util.Map<K,T> findMap(java.lang.String a,
         java.lang.Class<K> b)
        Executes the query and returns the results as a map of the objects.
      • findPagingList

        public  findPagingList(int pageSize)
        Returns a PagingList for this query.
      • findRowCount

        public int findRowCount()
        Returns the number of entities this query should return.
      • findSet

        public java.util.Set<T> findSet()
        Executes the query and returns the results as a set of objects.
      • findUnique

        public T findUnique()
        Executes the query and returns the results as either a single bean or null, if no matching bean is found.
      • findVisit

        public void findVisit( visitor)
      • findIterate

        public  findIterate()
      • getExpressionFactory

        public ExpressionFactory getExpressionFactory()
        Returns the ExpressionFactory used by this query.
      • getFirstRow

        public int getFirstRow()
        Returns the first row value.
      • getGeneratedSql

        public java.lang.String getGeneratedSql()
        Returns the SQL that was generated for executing this query.
      • getMaxRows

        public int getMaxRows()
        Returns the maximum of rows for this query.
      • getRawSql

        public RawSql getRawSql()
        Returns the RawSql that was set to use for this query.
      • getUseIndex

        public UseIndex getUseIndex()
      • having

        public  having()
        Returns the query's having clause.
      • having

        public  having(com.avaje.ebean.Expression addExpressionToHaving)
        Adds an expression to the having clause and returns the query.
      • having

        public  having(java.lang.String addToHavingClause)
        Adds clauses to the having clause and returns the query.
      • isAutofetchTuned

        public boolean isAutofetchTuned()
        Returns true if this query was tuned by autoFetch.
      • order

        public  order()
        Returns the order by clause so that you can append an ascending or descending property to the order by clause.

        This is exactly the same as orderBy().

      • order

        public  order(java.lang.String orderByClause)
        Sets the order by clause, replacing the existing order by clause if there is one.

        This is exactly the same as orderBy(String).

      • orderBy

        public  orderBy()
        Returns the order by clause so that you can append an ascending or descending property to the order by clause.

        This is exactly the same as order().

      • orderBy

        public  orderBy(java.lang.String orderByClause)
        Set the order by clause replacing the existing order by clause if there is one.

        This is exactly the same as order(String).

      • select

        public  select(java.lang.String fetchProperties)
        Explicitly sets a comma delimited list of the properties to fetch on the 'main' entity bean, to load a partial object.
      • setAutofetch

        public  setAutofetch(boolean autofetch)
        Explicitly specifies whether to use 'Autofetch' for this query.
      • setBackgroundFetchAfter

        public  setBackgroundFetchAfter(int backgroundFetchAfter)
        Sets the rows after which fetching should continue in a background thread.
      • setBufferFetchSizeHint

        public  setBufferFetchSizeHint(int fetchSize)
        Sets a hint, which for JDBC translates to Statement.fetchSize().
      • setDistinct

        public  setDistinct(boolean isDistinct)
        Sets whether this query uses DISTINCT.
      • setFirstRow

        public  setFirstRow(int firstRow)
        Sets the first row to return for this query.
      • setId

        public  setId(java.lang.Object id)
        Sets the ID value to query.
      • setListener

        public  setListener( queryListener)
        Sets a listener to process the query on a row-by-row basis.
      • setLoadBeanCache

        public  setLoadBeanCache(boolean loadBeanCache)
        When set to true, all the beans from this query are loaded into the bean cache.
      • setMapKey

        public  setMapKey(java.lang.String mapKey)
        Sets the property to use as keys for a map.
      • setMaxRows

        public  setMaxRows(int maxRows)
        Sets the maximum number of rows to return in the query.
      • setOrder

        public  setOrder( orderBy)
        Replaces any existing order by clause using an OrderBy object.

        This is exactly the same as #setOrderBy(com.avaje.ebean.OrderBy).

      • setOrderBy

        public  setOrderBy( orderBy)
        Set an OrderBy object to replace any existing order by clause.

        This is exactly the same as #setOrder(com.avaje.ebean.OrderBy).

      • setParameter

        public  setParameter(int position,
         java.lang.Object value)
        Sets an ordered bind parameter according to its position.
      • setParameter

        public  setParameter(java.lang.String name,
         java.lang.Object value)
        Sets a named bind parameter.
      • setQuery

        public  setQuery(java.lang.String oql)
        Sets the OQL query to run
      • setRawSql

        public  setRawSql(RawSql rawSql)
        Sets RawSql to use for this query.
      • setReadOnly

        public  setReadOnly(boolean readOnly)
        Sets whether the returned beans will be read-only.
      • setTimeout

        public  setTimeout(int secs)
        Sets a timeout on this query.
      • setUseCache

        public  setUseCache(boolean useBeanCache)
        Sets whether to use the bean cache.
      • setUseQueryCache

        public  setUseQueryCache(boolean useQueryCache)
        Sets whether to use the query cache.
      • setUseIndex

        public  setUseIndex(UseIndex useIndex)
      • setVanillaMode

        public  setVanillaMode(boolean vanillaMode)
        Sets whether to use 'vanilla mode', in which the returned beans and collections will be plain classes rather than Ebean-generated dynamic subclasses etc.
      • where

        public  where()
        Adds expressions to the where clause with the ability to chain on the ExpressionList.
      • where

        public  where(com.avaje.ebean.Expression expression)
        Adds a single Expression to the where clause and returns the query.
      • where

        public  where(java.lang.String addToWhereClause)
        Adds additional clauses to the where clause.
      • getTotalHits

        public int getTotalHits()
        Return the total hits matched for a lucene text search query.
      • setForUpdate

        public  setForUpdate(boolean forUpdate)
        Execute the select with "for update" which should lock the record "on read"
      • isForUpdate

        public boolean isForUpdate()
        Whether this query is for update

AltStyle によって変換されたページ (->オリジナル) /