concept result set in category seam

appears as: result set
Seam in Action

This is an excerpt from Manning's book Seam in Action.

The listing screen has two parts. The featured content is a table of all the courses found in the database, seen in the bottom half of the screen. This table has two key features. It can be sorted and paginated. The result set is broken into pages, truncated at a page size of 25 by default. Links at the bottom of the screen allow you to flip through the pages in the result set. The columns of the table are also sortable. The heading of each column is rendered as a link, allowing you to sort the table by that column. Now, tell me, how much time have you burned implementing sortable and paginated tables in an application in your career? If you winced at that question, you should be happy to see that seam-gen takes care of all that for you. So go ahead and revel in it by clicking on a couple of the column headers and flipping through the pages. You should notice that the sort is not lost when you paginate, the offset is not lost when you sort, and every page can be bookmarked. Another seam-gen special.

You’ll see how the framework aids in creating pages that list entities of a particular type retrieved from the database. But it doesn’t just dump all the records at once, which could potentially be a costly operation. Instead, it provides support for truncating the list into pages. The component that manages the query responds to pagination and sorting commands, and helps you develop a search filter to allow the user to pare down the result set.

10.4.5. Placing restrictions on the result set

Paging through hundreds of results can take its toll on your user. To make for a better experience, you need to let users help themselves to the data by giving them a way to supply criteria that pares down the result set. Searching is one of those tasks that has been long dreaded by developers because it almost always means building dynamic queries. If you’ve ever had to maintain code that uses a custom SQL builder to implement a search page, you can appreciate how much pain is involved. That’s why effort was put into establishing an intelligent restriction mechanism for the Query component.