Class EJBQLQuery

java.lang.Object
org.apache.cayenne.query.CacheableQuery
org.apache.cayenne.query.EJBQLQuery
All Implemented Interfaces:
Serializable, Query

public class EJBQLQuery extends CacheableQuery
An EJBQL query representation in Cayenne.
Since:
3.0
See Also:
  • Field Details

  • Constructor Details

    • EJBQLQuery

      public EJBQLQuery(String ejbqlStatement)
    • EJBQLQuery

      public EJBQLQuery()
  • Method Details

    • initWithProperties

      public void initWithProperties(Map<String,?> properties)
    • getMetaData

      public QueryMetadata getMetaData(EntityResolver resolver)
      Description copied from interface: Query
      Returns query runtime parameters. The method is called at various stages of the execution by Cayenne access stack to retrieve query parameters. EntityResolver instance is passed to this method, meaning that the query doesn't need to store direct references to Cayenne mapping objects and can resolve them at runtime.
    • isFetchingDataRows

      public boolean isFetchingDataRows()
    • setFetchingDataRows

      public void setFetchingDataRows(boolean flag)
    • getBaseMetaData

      protected org.apache.cayenne.query.BaseQueryMetadata getBaseMetaData()
      Specified by:
      getBaseMetaData in class CacheableQuery
    • route

      public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)
      Description copied from interface: Query
      A callback method invoked by Cayenne during the routing phase of the query execution. Mapping of DataNodes is provided by QueryRouter. Query should use a QueryRouter.route(QueryEngine, Query, Query) callback method to route itself. Query can create one or more substitute queries or even provide its own QueryEngine to execute itself.
    • createSQLAction

      public SQLAction createSQLAction(SQLActionVisitor visitor)
      Description copied from interface: Query
      A callback method invoked by Cayenne during the final execution phase of the query run. A concrete query implementation is given a chance to decide how it should be handled. Implementors can pick an appropriate method of the SQLActionVisitor to handle itself, create a custom SQLAction of its own, or substitute itself with another query that should be used for SQLAction construction.
    • getEjbqlStatement

      public String getEjbqlStatement()
      Returns an unparsed EJB QL statement used to initialize this query.
    • getExpression

      public EJBQLCompiledExpression getExpression(EntityResolver resolver) throws EJBQLException
      Returns lazily initialized EJBQLCompiledExpression for this query EJBQL.
      Throws:
      EJBQLException
    • getNamedParameters

      public Map<String,Object> getNamedParameters()
      Returns unmodifiable map of combined named and positional parameters. Positional parameter keys are Integers, while named parameter keys are strings.
    • getPositionalParameters

      public Map<Integer,Object> getPositionalParameters()
    • setParameter

      public void setParameter(String name, Object object)
      Sets a named query parameter value.
    • setParameter

      public void setParameter(int position, Object object)
      Sets a positional query parameter value. Note that parameter indexes are starting from 1.
    • getFetchLimit

      public int getFetchLimit()
      Returns the fetchLimit property indicating the maximum number of rows this query would return.
    • setFetchLimit

      public void setFetchLimit(int fetchLimit)
      Sets the fetchLimit property indicating the maximum number of rows this query would return.
    • getFetchOffset

      public int getFetchOffset()
    • setFetchOffset

      public void setFetchOffset(int fetchOffset)
    • setEjbqlStatement

      public void setEjbqlStatement(String text)
    • getPageSize

      public int getPageSize()
    • setPageSize

      public void setPageSize(int pageSize)
    • setStatementFetchSize

      public void setStatementFetchSize(int size)
      Sets statement's fetch size (0 for no default size)
      Since:
      3.0
    • getStatementFetchSize

      public int getStatementFetchSize()
      Returns:
      statement's fetch size
      Since:
      3.0
    • setQueryTimeout

      public void setQueryTimeout(int queryTimeout)
      Sets query timeout.
      Since:
      4.2
    • getQueryTimeout

      public int getQueryTimeout()
      Returns:
      query timeout
      Since:
      4.2