Package org.crank.crud.controller

Examples of org.crank.crud.controller.FilterablePageable


  @Bean(scope = DefaultScopes.SESSION)
  public JsfCrudAdapter petClinicLeadCrud() throws Exception {
    /* Pull out the existing CrudAdapter. */
    JsfCrudAdapter adapter = cruds().get("PetClinicLead");
    /* Grab its filtering paginator and configure it. */
    FilterablePageable paginator = adapter.getPaginator();
    /* Call addFilterableEntityJoin padding the class we are joining to,
     * the name of the entity, the name of the alias,
     * an array of property names, and an optional join that will be added to the where clause.
     */
    paginator.addFilterableEntityJoin(PetClinicInquiry.class, //Class we are joining
          "PetClinicInquiry", //Entity name
          "inquiry", //
          new String []{"anotherProp"}, //Array of property names we want to join to.
          "o.inquiry"); //How to join to the PetClinicLead
    paginator.filter();
    return adapter;
  }
View Full Code Here


  @Bean(scope = DefaultScopes.SESSION)
  public JsfCrudAdapter petClinicLeadCrud() throws Exception {
    /* Pull out the existing CrudAdapter. */
    JsfCrudAdapter adapter = cruds().get("PetClinicLead");
    /* Grab its filtering paginator and configure it. */
    FilterablePageable paginator = adapter.getPaginator();
    /* Call addFilterableEntityJoin padding the class we are joining to,
     * the name of the entity, the name of the alias,
     * an array of property names, and an optional join that will be added to the where clause.
     */
    paginator.addFilterableEntityJoin(PetClinicInquiry.class, //Class we are joining
          "PetClinicInquiry", //Entity name
          "inquiry", //
          new String []{"anotherProp"}, //Array of property names we want to join to.
          "o.inquiry"); //How to join to the PetClinicLead
    paginator.filter();
    return adapter;
  }
View Full Code Here

  @Bean(scope = DefaultScopes.SESSION)
  public JsfCrudAdapter petClinicLeadCrud() throws Exception {
    /* Pull out the existing CrudAdapter. */
    JsfCrudAdapter adapter = cruds().get("PetClinicLead");
    /* Grab its filtering paginator and configure it. */
    FilterablePageable paginator = adapter.getPaginator();
    /* Call addFilterableEntityJoin padding the class we are joining to,
     * the name of the entity, the name of the alias,
     * an array of property names, and an optional join that will be added to the where clause.
     */
    paginator.addFilterableEntityJoin(PetClinicInquiry.class, //Class we are joining
          "PetClinicInquiry", //Entity name
          "inquiry", //
          new String []{"anotherProp"}, //Array of property names we want to join to.
          "o.inquiry"); //How to join to the PetClinicLead
    paginator.filter();
    return adapter;
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Test
  public void testPagination() {
    FilterablePageable paginator = petClinicLeadCrud.getPaginator();
        List page = paginator.getPage();
    assert page.size() > 0 : "There is some data in here";
   
    System.out.println("paginator 1"  + paginator);
   
    petClinicLeadCrud.clear();
View Full Code Here

                       /* Set the entity class into the crudController. */
                       crudControllerTarget.setEntityClass( mo.getEntityType() );

                       if (autoWireCrudToPaginators) {
                         final FilterablePageable filterablePageable = pagers().get(mo.getName());
                         if (filterablePageable != null) {
                           crudControllerTarget.addCrudControllerListener(new CrudControllerListenerAdapter() {
               
                          public void afterCreate(CrudEvent event) {
                            filterablePageable.reset();
                }

                public void afterDelete(CrudEvent event) {
                  filterablePageable.reset();
                }

                public void afterUpdate(CrudEvent event) {
                  filterablePageable.reset();
                }

                 
                });
                         }
View Full Code Here

TOP

Related Classes of org.crank.crud.controller.FilterablePageable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.