FreeFormQueryDelegate examples dosen't work

Hi,

I’m starting with vaadin and get stuck with the SQLConatiner. I am able to use TableQuery for SELECTS on one table and using FreeFormQuery for SELECTS with joins and simple WHERE clauses (to check the user login against the database).

Now I am trying to show a table with data from two (or more) tables. Write support is not requeired, but all the Examples and source code I found doesen’t work.

For example this method:
public StatementHelper getQueryStatement(int offset, int limit)
throws UnsupportedOperationException {
StatementHelper sh = new StatementHelper();
StringBuffer query = new StringBuffer("SELECT * FROM PEOPLE “);
if (filters != null) {
query.append(FilterToWhereTranslator.getWhereStringForFilters(
filters, sh));
}
query.append(getOrderByString());
if (offset != 0 || limit != 0) {
query.append(” LIMIT “).append(limit);
query.append(” OFFSET ").append(offset);
}
sh.setQueryString(query.toString());
return sh;
}

gives error. The method “FilterToWhereTranslator.getWhereStringForFilters” dosen’t exist in vaadin 7.3.10

What I am looking for is an piece of code with a working FreeFormDelegate Implementation and the usage of a FreeFormQuery with this delegate.

Thanks for help.

P.S.: I am using Oracle 11gR2.

If anyone else is looking for the answer to this the ‘getWhereStringForFilters’ method now lives as a static method in com.vaadin.data.util.sqlcontainer.query.generator.filter.QueryBuilder.

The root of the problem that beginners to Vaadin (like myself) have is that the current Book of Vaadin still points to an implementation of FreeFormStatementDelegate which are not compatible with Vaadin 7.

May you post some 7+ compatible example?

Hi Dmitriy,

you could check out:
https://github.com/javadev/vaadin-sqlcontainer-demo/blob/master/src/main/java/com/vaadin/data/util/sqlcontainer/demo/DemoFreeformQueryDelegate.java