is this a JPAContainer bug?

I’m evaluating JPAContainer jpacontainer-addon-agpl-3.0 1.2.0

Test case:

  • Apply a filter that does not matchs any item,
  • Remove all filters,

on the table disappear all columns and the items does not appear again, while the container size is right.

Here the relevant code:


    { // Provider -> Container -> Table
      container.setEntityProvider(provider);
      container.setApplyFiltersImmediately(false);
      table.setContainerDataSource(container);
    }

  @Override
  public void doFilter() {
    container.removeAllFilters();

    final String textFilter = textFilterComponent.getValue();
    if (textFilter != null) container.addFilter(Filters.like("title", textFilter, false));

    container.applyFilters();

    getWindow().showNotification(container.size() + " Items found", Notification.TYPE_TRAY_NOTIFICATION);
  }

Hello,

I am having the same problem.

Could someone point out a solution for this?

Thank you,

Hi!

Could you please try with the newly released 2.0.0-RC1 available
here
? Note that the new version has undergone a lot of work and the filtering system has been rewritten, so you might need to update some of your code relating to filters. The Vaadin filtering API is exclusively in use now with the option to easily drop down and modify the generated CriteriaQuery if need be. I can promise you that it’s worth the work, though, since 2.0.0-RC1 is already much better and more useful than the 1.x series.

If you still experience problems with JPAContainer 2.0.0-RC1, please don’t hesitate to contact me and I’ll get it fixed before the 2.0.0 release.

HTH,
/Jonatan

hi
i’m trying jpa container 2.0, but i’m getting this error:

java.lang.AbstractMethodError: org.hibernate.ejb.EntityManagerImpl.getCriteriaBuilder()Ljavax/persistence/criteria/CriteriaBuilder;
com.vaadin.addon.jpacontainer.provider.LocalEntityProvider.doGetEntityCount(LocalEntityProvider.java:410)
com.vaadin.addon.jpacontainer.provider.LocalEntityProvider.getEntityCount(LocalEntityProvider.java:447)
com.vaadin.addon.jpacontainer.JPAContainer.size(JPAContainer.java:857)
com.vaadin.ui.AbstractSelect.size(AbstractSelect.java:721)
com.vaadin.ui.Table.refreshRenderedCells(Table.java:1446)
com.vaadin.ui.Table.attach(Table.java:3555)
com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:560)
com.vaadin.ui.Panel.setContent(Panel.java:233)
com.example.voucherview.VoucherviewApplication.buildMainLayout(VoucherviewApplication.java:36)
com.example.voucherview.VoucherviewApplication.init(VoucherviewApplication.java:20)
com.vaadin.Application.start(Application.java:554)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.startApplication(AbstractApplicationServlet.java:1213)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:484)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

i’m afraid i don’t know much of CriteriaBuilder…

thanks,
-henry

Looks very much like there is code compiled against different versions of some JARs than the ones in use - this error is caught by the compiler if compiling everything at once.

Check your classpath, including the versions of JPA and Hibernate JARs you are using.
This could also be an issue with against what versions of some JARs JPAContainer is compiled versus what is used in your project.

With JPAContainer 2.0.0-RC1 Works!
Great job!