1 Reply Latest reply on Jul 27, 2008 7:16 PM by Pete Muir

    Seam enabled hibernate filter problem

    Romain More Newbie

      I tried to setup a hibernate filter, enabled in components.xml, with a parameter.
      I have tested 3 scenarii :

      1. in hibernate filter, the parameter has type long, in the EL value in components.xml I inject a value of type Long : EL value result is always empty

      2. in hibernate filter def, long parameter, and String as EL result value : exception wrong type for parameter

      3. string as hibernte filter parameter and String as EL result value : OK !

      So I have 2 questions :

      • Is it a Seam or Hibernate problem ?

      • Is it a EL bug ?

      My components.xml code :

      <persistence:filter name="hasRights" enabled="#{identity.loggedIn}">
      <persistence:managed-persistence-context name="restrictedEntityManager"

      The definition of the filter :

        @FilterDef(name="hasRights", parameters={@ParamDef(type="string", name="companyId")})

      The Filter :

            condition="(company_id = :companyId)"