Class AbstractCannedQueryFactory<R>

  • All Implemented Interfaces:
    CannedQueryFactory<R>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
    Direct Known Subclasses:
    AbstractCachingCannedQueryFactory

    public abstract class AbstractCannedQueryFactory<R>
    extends Object
    implements CannedQueryFactory<R>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware
    Basic services for CannedQueryFactory implementations.
    Since:
    4.0
    Author:
    Derek Hulley
    • Constructor Detail

      • AbstractCannedQueryFactory

        public AbstractCannedQueryFactory()
    • Method Detail

      • setBeanName

        public void setBeanName​(String name)
        Set the name with which to register
        Specified by:
        setBeanName in interface org.springframework.beans.factory.BeanNameAware
        Parameters:
        name - the name of the bean
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Registers the instance
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • getQueryExecutionId

        protected String getQueryExecutionId​(CannedQueryParameters parameters)
        Helper method to construct a unique query execution ID based on the instance of the factory and the parameters provided.
        Parameters:
        parameters - the query parameters
        Returns:
        a unique query instance ID
      • getCannedQuery

        public CannedQuery<R> getCannedQuery​(Object parameterBean,
                                             int skipResults,
                                             int pageSize,
                                             String queryExecutionId)
        Retrieve an instance of a CannedQuery based on limited parameters.
        Specified by:
        getCannedQuery in interface CannedQueryFactory<R>
        Parameters:
        parameterBean - the values that the query will be based on or null if not relevant to the query
        skipResults - results to skip before page
        pageSize - the size of page - ie. max items (if skipResults = 0)
        queryExecutionId - ID of a previously-executed query to be used during follow-up page requests - null if not available
        Returns:
        an implementation that will execute the query