FreeformQuery myQuery = new FreeformQuery("SELECT * FORM Table", connectionPool, "Id");
MyDelegate myDelegate = new MyDelegate();
myQuery.setDelegate(myDelegate);
container = new SQLContainer(myQuery);
I debugged it and saw that the problem comes from Table.class resetPageBuffer();
It worked fine, but when I added a new row into the table, it doesn’t set a new row as container Data Source. It didn’t work when I had restarted the server also. I don’t know that can be wrong.
Thank you for your help.
To debug this, you could try to set a breakpoint in Table.getVisibleCellsNoCache() on all the lines that add something to exceptionsDuringCachePopulation and see what the original problem is.
com.vaadin.ui.Table$CacheUpdateException: Error during Table cache update
also occurs when you set a NestedContainerProperty (of BeanItemCountainer) as eg: “coutry.name”
and when at the container set a List in which one or more User has getCountry() method that returns a null value
instead of displaying a empty cell, throws the Exception above indicated which has as cause NullPointerException
With this issue of nulls in nested property paths, I suggest to use a simple implementation of a ColumnGenerator. It doesn’t require to change your bean classes, and you can use it in all cases where you need to display nested properties in tables. I wrote a NestedPropertyColumnGenerator like this:
In the example above, you can then use the ColumnGenerator like this:
table.addGeneratedColumn("countryname", new NestedPropertyColumnGenerator("country.name"));
Note it uses a reflection utility class from the Spring framework, so if you don’t use Spring in your project, it will be necessary to use a different reflection mechanism.