Class DefaultFlexibleSearchService

  • All Implemented Interfaces:
    FlexibleSearchService, java.io.Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

    public class DefaultFlexibleSearchService
    extends AbstractBusinessService
    implements FlexibleSearchService
    Default implementation of the flexible search service.
    Since:
    4.0
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultFlexibleSearchService

        public DefaultFlexibleSearchService()
    • Method Detail

      • getModelByExample

        public <T> T getModelByExample​(T example)
        Description copied from interface: FlexibleSearchService
        Search for an existing object (in the database) by a given (not saved) example. Every modified attribute in this example is used as search parameter.
        Specified by:
        getModelByExample in interface FlexibleSearchService
        Type Parameters:
        T - the type of the example and the return type
        Parameters:
        example - the example
        Returns:
        the result if this was found by the example.
      • getModelsByExample

        public <T> java.util.List<T> getModelsByExample​(T example)
        Description copied from interface: FlexibleSearchService
        Search for an existing objects (in the database) by a given (not saved) example. Every modified attribute in this example is used as search parameter. Returns all matching results.
        Specified by:
        getModelsByExample in interface FlexibleSearchService
        Type Parameters:
        T - the type of the example and the return type
        Parameters:
        example - the example
        Returns:
        the list of models found by the example.
      • lookupConverterRegistry

        public ConverterRegistry lookupConverterRegistry()
        Must be overwritten! Use <lookup-method> in spring.
      • lookupModelSearchStrategy

        public ModelSearchStrategy lookupModelSearchStrategy()
        Must be overwritten! Use <lookup-method> in spring.
      • search

        public <T> SearchResult<T> search​(java.lang.String query)
        Simplest search available.
        Specified by:
        search in interface FlexibleSearchService
        Parameters:
        query - the query
        Returns:
        the search result< t>
      • search

        public <T> SearchResult<T> search​(java.lang.String query,
                                          java.util.Map<java.lang.String,​? extends java.lang.Object> queryParams)
        Convenience method which internally delegates to FlexibleSearchService.search(FlexibleSearchQuery).
        Specified by:
        search in interface FlexibleSearchService
        Parameters:
        query - query string in flexible search syntax
        queryParams - additional query parameters; null permitted
        Returns:
        the search result< t>
      • setMultiModelResolver

        public void setMultiModelResolver​(ItemObjectResolver multiModelResolver)
      • getModelConverterByModel

        protected ModelConverter getModelConverterByModel​(java.lang.Object model)
      • getSourceTypeFromModel

        protected java.lang.String getSourceTypeFromModel​(java.lang.Object model)
      • getFlexibleSearchInstance

        protected FlexibleSearch getFlexibleSearchInstance()
      • toPersistenceLayer

        public <T> T toPersistenceLayer​(java.lang.Object modelValue)