0 Replies Latest reply on May 25, 2007 4:33 AM by thierry.rietsch

    Getting part of a collection with EQL

      Hi all

      I try to get part of a collection over hql. In the Hibernate tutorial it is sugested to use the criterias to get the data from a collection. As we are using JBoss Seam framework we rely on EJB.

      @Entity
      // ...
      class SoftwareInventoryObject {
       // other code
       String name;
      
       @OneToMany
       List<SoftwareInventoryObjectPart> parts;
      
       // Getter & Setter
      }
      
      @Entity
      class SoftwareInventoryObjectPart {
       // other code
       String name;
       // other code
      }
      


      My first try was to get the SoftwareInventoryObject over this query:
      "from SoftwareInventoryObject sio where sio.name = 'foo' and sio.parts.name = 'bar'". Unfortunately this doesn't work. How do I get this running?

      Thank you very much for your help,

      Thierry