ResultSet based Table Model and table filter

41 views
Skip to first unread message

Matthias Lang

unread,
Nov 27, 2015, 5:00:40 AM11/27/15
to tablefilter-swing
I am wondering how to effectively work with tablefilter when using a resultset based tabel model.

I am currently experimenting with a table model that is backed by a scrollable result set. This way, not all the data needs to get loaded, and only the rows are actually loaded by the result set which get displayed. This is very effective for big tables, e.g. if you have hundred thousands or millions of records.

I have also written an own RowSorter class which is also backed by the result set model and which then simply re-queries the table by adding "order by" statements in the sql query. This works also very good, as not all data needs to be loaded for sorting as with the default row sorter.

My question is now, if I could use table filter also the same manner.

In the default mode tablefilter just simply iterates all the table data for filtering or to figure out auto choices. This is not useful for very big tables, and especially not for those where the model also loads the data lazily as in my case.

Now my question is, if tablefilter could be used or modified to work by using sql queries for filtering rather than doing the filtering in java? Is this possible? If not, would it be possible by overriding/implementing which parts in the code?


coderazzi

unread,
Nov 29, 2015, 4:55:22 PM11/29/15
to tablefilter-swing
Hi, Matthias,

Your idea is very good, and definitely the way to go to handle big datasets.
However, the changes on the library would be too big; for example, not
all data is handled as text-based (it supports cell rendering based on
the columns contents) -but this is okay, that part can be removed.
Furthermore, all parser logic should be removed as well -but again,
removal is easy,
To handle this, I would create a different library, that could reuse
the UI part and the parsing of information in the filters, converting
that, as you suggest, to SQL queries. This conversion should be rather
easy to do. But you would need as well to capture the sorting events,
as the JTable itself would not be anymore in charge of the sorting
part.

I can help you doing this, but at the moment I lack the time to do the
changes myself. What do you think?

Kind regards,

L.
> --
> You received this message because you are subscribed to the Google Groups
> "tablefilter-swing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tablefilter-sw...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages