2 Replies Latest reply on Jul 25, 2006 5:34 PM by Emmanuel Bernard

    EJB3 and Filter Annotation

    Jay Sellers Newbie

      I'm wondering if EJB3 has, or will have, support for the Filter annotation as in Hibernate (@Filter).

      I'm looking for a non-hibernate specific solution to the following problem:

      -- fooName
      -- fooType
      -- fooActive_Y_N

      I'd like every query of the FooTable to filter results and only return those records that have fooActive_Y_N == Y. I'd like this to take place throughout the system and not build the criteria with this Restriction every time, nor use QueryByExample with the property set. I'd like the DAO to know nothing about this except in cases where non-active records are requested.

      I believe I can implement an interceptor to accomplish this, but was wondering if there was a way to do the same with a simple annotation in EJB3, as there is in Hibernate.

      Thanks much