Class DefaultPaginatedGenericDao<M extends ItemModel>

    • Constructor Detail

      • DefaultPaginatedGenericDao

        public DefaultPaginatedGenericDao​(java.lang.String typeCode)
        Sets typeCode where this DefaultPaginatedGenericDao will search from. This constructor is an essential part of this Dao because it creates a query string based on the typeCode.
        Parameters:
        typeCode - the typeCode where this Dao will search from.
    • Method Detail

      • find

        public SearchPageData<M> find​(java.util.Map<java.lang.String,​?> params,
                                      SearchPageData searchPageData)
        Description copied from interface: PaginatedGenericDao
        Search for all instances of model given as a generic type matching given FlexibleSearchQuery parameters.
        Specified by:
        find in interface PaginatedGenericDao<M extends ItemModel>
        Parameters:
        params - parameters to be added in search query's "WHERE" clause as Map with parameter name as a key and parameter value as a value.
        searchPageData - the searchPageData including sorts and pagination information to be applied in the results
        Returns:
        SearchPageData containing paginated and sorted search results
      • createQueryString

        protected java.lang.StringBuilder createQueryString()
        Creates a search query for the typeCode which is set from constructor
        Returns:
        StringBuilder with basic search query for the typeCode
      • appendWhereClausesToBuilder

        protected void appendWhereClausesToBuilder​(java.lang.StringBuilder builder,
                                                   java.util.Map<java.lang.String,​?> params)
        Appends "WHERE" clause to the given builder with given params if it is not empty, otherwise do nothing
        Parameters:
        builder - the query builder containing "SELECT ... FROM ..." portion of query
        params - the map containing FlexibleSearchQuery parameters
      • setPaginatedFlexibleSearchService

        public void setPaginatedFlexibleSearchService​(PaginatedFlexibleSearchService paginatedFlexibleSearchService)