I'm looking at a search form for "persons" that can be either active or inactive. The search form itself has an Active field with three states: Yes, No, All. The SQL code is created using execAddSearchTerms.

At the same time, I have an advanced search tab using an AbstractPersonComposerField that inherits from AbstractComposerField. There, I have an attribute called Active using the Boolean code type. The SQL Statement is generated a bit differently, unfortunately:

Above is pre eclipse-scout code and also has legacy status.
Sql fragments on client side is not supported and not recommenden in applications.

For performing search and find processing logic based on search forms, eclipse scout also makes use of form data classes as in normal forms.
The above example search form PersonSearchForm has a form data PersonSearchFormData that can be passed to the back-end as search criteria set.

When used for example in the PersonTablePage, the following parts are normally of interest:
The SearchFilter object has the three properties completed boolean if the search is complete e.g. valid to obtain search resultsdisplayTexts list of strings of verbose description of the search elementsformData object containing the non-empty values of the form

When saved, the search form is automatically collecting all verbose search texts on the form fields
and calling execResetSearchFilter(...)

In the PersonSearchForm override the method execResetSearchFilter to set the form data to the search filter object:

The IPersonProcessService.getPersonTableData operation uses the search filter and retrieves the data from the data stores.
This might be using hibernate, eclipse link or direct jdbc access.
When using direct jdbc access there is a helper base class to easily create jdbc statement builders based on a form data.
We create a subclass PersonSearchStatementBuilder.
As in Alex's example the composer attribute "Active" is just mapped to a sql part and the three-state radio button "Active" is implemented as java code in the "buildeConstraintsFor" method override.