TaackSimpleFilterService (taack-ui 0.3.9-SNAPSHOT API)
Package: taack.base

[Groovy] Class TaackSimpleFilterService

    • taack.base.TaackSimpleFilterService
    • All Implemented Interfaces and Traits:
      grails.web.api.WebAttributes


      @groovy.transform.CompileStatic
      class TaackSimpleFilterService
      extends java.lang.Object
      implements grails.web.api.WebAttributes

      Service allowing to automatically filter data in a tableFilter. It is typically used in a table block. It uses params given from the UiFilterSpecifier to filter data.

      The main methods are named TaackSimpleFilterService.list<T>. The uniq mandatory parameter is the Class we want the list for. Optional params includes allowed ids or passing a filter directly allow to restrict the list of objects returned.

      • Methods Summary

          Methods 
          Type Params Return Type Name and description
          final java.util.List<java.lang.Object> executeQuery(java.lang.String query, java.util.Map<java.lang.String, java.lang.Object> namedParams, java.lang.Integer max, java.lang.Integer offset)
          Helper method allowing to execute a query
          <T> final T executeQueryUniqueResult(java.lang.Class<T> aClass, java.util.Map<java.lang.String, java.lang.Object> namedParams, java.lang.String query, java.lang.Integer max, java.lang.Integer offset)
          Helper method allowing to execute a query, after a type, returning an uniq result.
          <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> list(java.lang.Class<T> aClass, int max, SortableDirection sortableDirection, T tInstance)
          list entities and number of results
          <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> list(java.lang.Class<T> aClass, int max, SortableDirection sortableDirection, java.util.Collection<java.lang.Long> idsInList)
          list entities and number of results
          <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> list(java.lang.Class<T> aClass, int max, UiFilterSpecifier filterSpecifier, T tInstance, SortableDirection sortableDirection, java.util.Collection<java.lang.Long> idsInList)
          list entities and number of results
          <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> list(UiTableSpecifier table)
          java.util.List listGroup(java.lang.Class aClass)
          When a group header is present in the table, list the distinct values for the selected group (without applying the filter)
          <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> listInGroup(java.lang.Object group, java.lang.Class<T> aClass, UiFilterSpecifier f, T t)
          List objects in the given group
          final java.util.Map mapFilterDump(UiFilterSpecifier filter)
      • Inherited Methods Summary

          Inherited Methods 
          Methods inherited from class Name
          class java.lang.Object java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
      • Property Detail

        • org.hibernate.SessionFactory sessionFactory

      • Constructor Detail

        • TaackSimpleFilterService()

      • Method Detail

        • final java.util.List<java.lang.Object> executeQuery(java.lang.String query, java.util.Map<java.lang.String, java.lang.Object> namedParams, java.lang.Integer max, java.lang.Integer offset)

          Helper method allowing to execute a query

          Parameters:
          query
          max - max number of results
          offset
          Returns:
          the list of objects

        • <T> final T executeQueryUniqueResult(java.lang.Class<T> aClass, java.util.Map<java.lang.String, java.lang.Object> namedParams, java.lang.String query, java.lang.Integer max, java.lang.Integer offset)

          Helper method allowing to execute a query, after a type, returning an uniq result. @return

          Parameters:
          aClass
          query
          max
          offset

        • <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> list(java.lang.Class<T> aClass, int max, SortableDirection sortableDirection, T tInstance)

          list entities and number of results

          Parameters:
          aClass - type we want to list
          max - (optional) max number of results
          sortableDirection - (optional) sort parameter
          tInstance - object of the same class as aClass, allowing to add filter criteria
          Returns:
          pair that contains the max results and the total number of objects reached by the filter

        • <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> list(java.lang.Class<T> aClass, int max, SortableDirection sortableDirection, java.util.Collection<java.lang.Long> idsInList)

          list entities and number of results

          Parameters:
          aClass - type we want to list
          max - (optional) max number of results
          sortableDirection - (optional) sort parameter
          idsInList - restrict the results to those ids
          Returns:
          pair that contains the max results and the total number of objects reached by the filter

        • <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> list(java.lang.Class<T> aClass, int max, UiFilterSpecifier filterSpecifier, T tInstance, SortableDirection sortableDirection, java.util.Collection<java.lang.Long> idsInList)

          list entities and number of results

          Parameters:
          aClass - type we want to list
          max - (optional) max number of results
          filterSpecifier - (optional) additional filter criteria that overrides the ones passed via params
          tInstance - (optional) object of the same class as aClass, allowing to add filter criteria
          sortableDirection - (optional) sort parameter
          idsInList - (optional) restrict the results to those ids
          Returns:
          pair that contains the max results and the total number of objects reached by the filter

        • <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> list(UiTableSpecifier table)

        • java.util.List listGroup(java.lang.Class aClass)

          When a group header is present in the table, list the distinct values for the selected group (without applying the filter)

          Parameters:
          aClass - class displayed in the table
          Returns:
          list of distinct value

        • <T extends GormEntity> final grails.util.Pair<java.util.List<T>, java.lang.Long> listInGroup(java.lang.Object group, java.lang.Class<T> aClass, UiFilterSpecifier f, T t)

          List objects in the given group

          Parameters:
          group - the group (from listGroup(Class)
          aClass - class displayed in the table
          f - filter to apply while retrieving the list
          t - object instance of type aClass that add filter criteria
          Returns:
          pair that contains list of objects and the number of objects reached by the query