Class CustomQuerySelectorDatasource

    • Constructor Detail

      • CustomQuerySelectorDatasource

        public CustomQuerySelectorDatasource()
    • Method Detail

      • getData

        protected List<Map<String,​Object>> getData​(Map<String,​String> parameters,
                                                         int startRow,
                                                         int endRow)
        Description copied from class: ReadOnlyDataSourceService
        Read/create the set of data as a list of Maps with key-value pairs.
        Specified by:
        getData in class ReadOnlyDataSourceService
        Parameters:
        parameters - the parameters passed in from the request
        startRow - the first row to read (maybe -1 to indicate no startrow)
        endRow - the last row to read (maybe -1 to indicate no endrow
        Returns:
        the number of objects read, note that this maybe more than endRow - startRow + 1. The startRow parameter should be strictly followed though.
      • parseOptionalFilters

        public String parseOptionalFilters​(Map<String,​String> parameters,
                                           Selector selector,
                                           SimpleDateFormat xmlDateFormat,
                                           List<Object> typedParameters)
        Returns the selectors HQL query. In case that it contains the '@additional_filters@' String it is replaced by a set of filter clauses. These include a filter clause:
        • for the main entity's client by the context's client.
        • for the main entity's organization by an organization list see DataSourceUtils.getOrgs(String)
        • with Selector's default filter expression.
        • for each default expression defined on the selector fields.
        • for each selector field in case exists a value for it on the parameters param.
        Parameters:
        parameters - Map of String values with the request parameters.
        selector - the selector that it is being retrieved the data.
        xmlDateFormat - SimpleDataFormat to be used to parse date Strings.
        Returns:
        a String with the HQL to be executed.
      • parseOptionalFilters

        public String parseOptionalFilters​(Map<String,​String> parameters,
                                           Selector selector,
                                           SimpleDateFormat xmlDateFormat,
                                           List<Object> typedParameters,
                                           Map<String,​Object> namedParameters)
        Returns the selectors HQL query. In case that it contains the '@additional_filters@' String it is replaced by a set of filter clauses. These include a filter clause:
        • for the main entity's client by the context's client.
        • for the main entity's organization by an organization list see DataSourceUtils.getOrgs(String)
        • with Selector's default filter expression.
        • for each default expression defined on the selector fields.
        • for each selector field in case exists a value for it on the parameters param.
        Parameters:
        parameters - Map of String values with the request parameters.
        selector - the selector that it is being retrieved the data.
        xmlDateFormat - SimpleDataFormat to be used to parse date Strings.
        typedParameters - Typed parameters to be used in the query
        namedParameters - Named parameters to be used in the query
        Returns:
        a String with the HQL to be executed.