Hi Björn-Peter,

Have a look at DefaultDataTable which is part of the wicket-extensions module


|*DefaultDataTable <http://wicket.sourceforge.net/wicket-extensions/apidocs/wicket/extensions/markup/html/repeater/data/table/DefaultDataTable.html#DefaultDataTable%28java.lang.String,%20wicket.extensions.markup.html.repeater.data.table.IColumn%5B%5D,%20wicket.extensions.markup.html.repeater.util.SortableDataProvider,%20int%29>*(java.lang.String id, IColumn <http://wicket.sourceforge.net/wicket-extensions/apidocs/wicket/extensions/markup/html/repeater/data/table/IColumn.html>[] columns, SortableDataProvider <http://wicket.sourceforge.net/wicket-extensions/apidocs/wicket/extensions/markup/html/repeater/util/SortableDataProvider.html> dataProvider, int rowsPerPage)|

you put the Hibernate stuff into a service layer (so you can use the spring @Transactional annotation) and then have that called through your implementation of the SortableDataProvider.

The IColumn's define the columns that will appear in the table.

If you have a small number of results you could extract seperately and use the ListDataProvider (java.util.List list) to provide data for the table.

If you have a large data set you should implement your own version that pages through hibernate. add one of the toolbars to get this pagination functionality automatically. (dataTable.addTopToolbar (new NavigationToolbar()))

Regards,

Mike




I want to execute a simple sql-count-query with a "group by" statement and display the result in a html-table...

something like:
session = HibernateUtil.getSessionFactory().getCurrentSession();
           session.beginTransaction();
String SQL_QUERY = "SELECT COUNT(*),Date FROM Person Group By Date";
           Query query = session.createQuery(SQL_QUERY);


What is the best way to manage that, not using too much fancy stuff...?

Cheers B

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to