0 Replies Latest reply on Sep 12, 2007 6:48 AM by Jaime Martin

    query restrictions with id primary key element

    Jaime Martin Apprentice

      Hello,
      by means of seam-gen I have a POJO with an id attribute. The id is in fact another POJO. All is ok according to the database.
      I´ve defined a query in componentes.xml. It works properly:

       <framework:entity-query name="POJOView"
       ejbql="select pojo from POJO pojo">
       <framework:restrictions>
       <value>pojo.atb1 = #{object.atb1}</value>
       </framework:restrictions>
       </framework:entity-query>




      But if I use a restriction wich access to an id attribute it returns no error but no elements, and there are elements indeed.(With standard sql that info is retrieved)
      For example:

       <framework:entity-query name="POJOView"
       ejbql="select pojo from POJO pojo">
       <framework:restrictions>
       <value>pojo.id.atb2 = #{object.value}</value>
       </framework:restrictions>
       </framework:entity-query>



      #{object.value} has a proper value for pojo.id.atb2, in the same way as #{object.atb1} has for pojo.atb1. All attributes have their public getters.

      Is there something special that must be done for restrictions when accessing a pojo.id.attribute?
      thank you!!