Although not all filters support is coded yet, the strategy to filtering queries for ArcSDE
datasources is separated in two parts, the SQL where clause construction, provided here and the
spatial filters (or spatial constraints, in SDE vocabulary) provided by
GeometryEncoderSDE; mirroring the java SDE api approach for easy programing

visit

Writes the SQL for the attribute Expression. NOTE: If the feature type is the product of an
in process sql query, the attribute name encoded will be the actual one, not the alias (if
any) used in the sql query.

writeLiteral

Writes out a non null, non geometry literal. The base class properly handles
null, numeric and booleans (true|false), and turns everything else into a string.
Subclasses are expected to override this shall they need a different treatment
(e.g. for dates)