filter challenge with Hbncontainer (support for filters?)

Hello everybody

I would like to know if the method

void addContainerFilter(Filter filter) will be implemented in near future.

Or can anybody please tell me how I can get over the following challenge?

I have an SQL table with let’s say an ID, first_name, last_name.
ID is of type Bigint, first_name and last_name of type varchar.

I want to get the tupels with a specific ID. I tried it with com.vaadin.data.util.filter.Like but no success
because only old style addContainerFilter(Object, String, boolean booblean) API is supported.

This method throws a cast exception because it can’t cast a String to long.

Thank you very much for any suggestions.

Hi,

I haven’t got time to develop the Add-on for a while. Mainly because it is not official Vaadin product and I have had more interesting “hobby projects” like OpenLayers and various server push solutions. I have only applied patches that the community has provided. Those are still welcome.

I have two suggestions:

  1. override a method from the container called getBaseCriteria or something similar (don’t remember exactly the name of the method). Using that you should be able to customize the query as you like.
  2. Go for Pro and start using Vaadin JPAContainer instead. We are currently working on the next big version of it and it should easily adapt to your requirements.

PS. If somebody wants to take the HbnContainer project under his/her governance, please contact me and we’ll do some arrangements.

cheers,
matti

Hi Matti,

I am very appreciated your help! I have overridden the method getBaseCriteria() and it works prefect.

For which main reason should I rather choose the JPAContainer instead of your Hbncontainer?

Hi,

JPAContainer pros:

  • currently actively developed
  • supported by Vaadin Ltd., e.g. bug fixes if you are PRO account subscriber. With HbnContainer you only have community or your own skills if you need to fix something.

Cons:

  • price, unless you have open source project (dual licensed AGPL/CVAL)

cheers,
matti

hello Andreas,
Would you mind posting an example of how you overridden the function in hbncontainer to fit custom criterions

thanks for your help
Chris

I don’t use Hbncontainer anymore in the meantime. In the same way the code has gone away, and I can’t exactly remember what I’ve implemented.
I might have time to have a look at it later. Sorry about that.