TaackFilter (taack-ui 0.4.0-SNAPSHOT API)
Package: taack.domain

[Groovy] Class TaackFilter<T extends GormEntity>

    • taack.domain.TaackFilter


    • @groovy.transform.CompileStatic
      final class TaackFilter<T extends GormEntity>
      extends java.lang.Object

      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 TaackFilter.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.

      • Constructor Summary

          Constructors 
          Constructor and description
          TaackFilter (TaackFilter.FilterBuilder filterBuilder, org.hibernate.SessionFactory sessionFactory, java.util.Map<java.lang.String, ? extends java.lang.Object> theParams)
      • 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
          final java.lang.Long executeQueryUniqueResult(java.lang.Class 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.
          final grails.util.Pair<java.util.List<T>, java.lang.Long> list(java.lang.Class<T> aClass, int max, UiFilterSpecifier filterSpecifier, T tInstance, FieldInfo[] fields, TaackFilter.Order order, java.util.Collection<java.lang.Long> idsInList)
          list entities and number of results
          final grails.util.Pair<java.util.List<T>, java.lang.Long> list()
          java.util.List listGroup()
          When a group header is present in the table, list the distinct values for the selected group (without applying the filter)
          final grails.util.Pair<java.util.List<T>, java.lang.Long> listInGroup(java.lang.Object group, UiFilterSpecifier f, T t)
          List objects in the given group
          final java.util.Map mapFilterDump(UiFilterSpecifier filter)
          java.lang.String toString()
      • 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()
      • Constructor Detail

        • TaackFilter(TaackFilter.FilterBuilder filterBuilder, org.hibernate.SessionFactory sessionFactory, java.util.Map<java.lang.String, ? extends java.lang.Object> theParams)

      • 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

        • final java.lang.Long executeQueryUniqueResult(java.lang.Class 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

        • final grails.util.Pair<java.util.List<T>, java.lang.Long> list(java.lang.Class<T> aClass, int max, UiFilterSpecifier filterSpecifier, T tInstance, FieldInfo[] fields, TaackFilter.Order order, 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

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

        • java.util.List listGroup()

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

          Returns:
          list of distinct value

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

          List objects in the given group

          Parameters:
          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

        • @java.lang.Override java.lang.String toString()