Using SQLContainer with Hibernate HQL

It seems to be that it would be relatively straightforward to add support for Hibernate HQL queries to the Vaadin SQLContainer project. Although the HbnContainer works fine for us with objects persisted in Hibernate, often we want to query across many objects in the graph (ie across multiple tables in the database) and that would be much better done in HQL.

I figure that it would be just a matter of implementing an appropriate QueryDelegate class that supports Hibernate HQL.

But before I do that, I wonder if anyone else has done this? I doubt I’m the first to think of using HQL in SQLContainer. Has anyone else done it? Can anyone provide code or examples using HQL?

thanks
Charles

Well I didn’t get any responses, so I went ahead and implemented basic support for Hibernate HQL in SqlContainer. The implementation includes:

  • HqlQueryDelegate which implements com.vaadin.addon.sqlcontainer.query.QueryDelegate
  • HqlResultSet which implements java.sql.ResultSet
  • HqlResultSetMetaData which implements java.sql.ResultSetMetaData

The implementation is fairly basic, as it is read-only and has pretty limited exception handling. However it does fully support filtering, sorting and lazy loading so it’s a good start.

I expect that once I’ve refined it a bit, I’ll make the code available so that other people can make use of it…

surely sounds promising. any refinement-actions done already? i’d give it a try.

I’d be interested in using HQL with Vaadin as well. Is there any chance you can release the code?