0 Replies Latest reply on Aug 29, 2011 11:05 AM by JEE 4 Hire

    How to sort and filter nested entity property using JPADataModel

    JEE 4 Hire Newbie

      Using JPADataModel

      http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=dataTable&sample=arrangeableModel&skin=blueSky'

       

      How can I sort and filter a nested entity property?  What changesd do I have to make to the example to sort and filter by the name of

      the engine in the following snippet?

       

              <rich:column sortBy="#{job.engine.name}" filterBy="#{job.engine.name}">

                  <f:facet name="header">

                      <h:outputText value="Name" />

                  </f:facet>

                  <h:outputText value="#{job.engine.name}" />

              </rich:column>

       

       

      @Entity

      public class Job implements Serializable {

        @Id @GeneratedValue

        private Long id;

        private Engine engine;

      ...

      }

       

      @Entity

      public class Engine implements Serializable {

        @Id @GeneratedValue

        private Long id;

        private String name;

      ...

      }