Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: query
    • Labels:
      None

      Description

      A class-level query filter that applies to all queries implicitly is a useful functionality and available in similar software product [1].

      The base functionality is:
      a) A class can be annotated with a query

      @Entity
      @Filter(query="SELECT x FROM PObject x WHERE x.field = f1 AND x.status =! DONE")
      public class PObject

      {...}

      b) Any query on class PObject will augment the class-level filter predicates.

      c) @Filter query can be parametrized. The parameters can be set on current FetchPlan.

      Will attach a draft/prototype for such functionality. Please take a look and let me know your valued comments.

      [1] http://www.hibernate.org/hib_docs/reference/en/html/filters.html

        Activity

        Hide
        Pinaki Poddar added a comment -

        A prototype for adding a class-level filter that augments any query

        Show
        Pinaki Poddar added a comment - A prototype for adding a class-level filter that augments any query
        Hide
        John Eckhart added a comment -

        I see this patch has been sitting around for almost three years. Is there any reason this (or similar functionality) wasn't pushed into main?

        Show
        John Eckhart added a comment - I see this patch has been sitting around for almost three years. Is there any reason this (or similar functionality) wasn't pushed into main?
        Hide
        Pinaki Poddar added a comment -

        > Please take a look and let me know your valued comments.
        > Is there any reason this (or similar functionality) wasn't pushed into main?

        Simply because you are the first one to show any interest in this.

        Show
        Pinaki Poddar added a comment - > Please take a look and let me know your valued comments. > Is there any reason this (or similar functionality) wasn't pushed into main? Simply because you are the first one to show any interest in this.
        Hide
        Aram Hovanisyan added a comment -

        This is a valuable request. Count me as another vote for this filter

        Show
        Aram Hovanisyan added a comment - This is a valuable request. Count me as another vote for this filter
        Hide
        Pinaki Poddar added a comment -

        I appreciate the support for this feature.
        A type-level filter that overlays on user queries would also be parameterized for majority of use cases. For example, an application may use the current user name/location as the global type-level filter parameter on some entities.
        Hence we need a requirement spec on how these query binding parameters are specified and how their values are sourced at runtime.

        Those of you who are interested in this type-level filtering, please suggest the syntax of filter specifications.

        The patch has laid out the design of this feature and the touchpoints in existing query execution pathway to sufficient details. But it has not addressed the parameter binding issue as well.

        Show
        Pinaki Poddar added a comment - I appreciate the support for this feature. A type-level filter that overlays on user queries would also be parameterized for majority of use cases. For example, an application may use the current user name/location as the global type-level filter parameter on some entities. Hence we need a requirement spec on how these query binding parameters are specified and how their values are sourced at runtime. Those of you who are interested in this type-level filtering, please suggest the syntax of filter specifications. The patch has laid out the design of this feature and the touchpoints in existing query execution pathway to sufficient details. But it has not addressed the parameter binding issue as well.
        Hide
        Vermeulen added a comment -

        Note that the jpasecurity project on sourceforge does something like this in it's @Permit annotation: it allows filtering based on the rights of the current user.

        Show
        Vermeulen added a comment - Note that the jpasecurity project on sourceforge does something like this in it's @Permit annotation: it allows filtering based on the rights of the current user.

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Pinaki Poddar
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development