I need to develop a search screen for an object. I know I need to build my SQL statement in code rather than a Stored Procedure (which sucks), but is there any examples or methodology on how to implement the build of the SQL statement. I want to allow searching by any number of fields and also allow "starts with", "ends with", "contains" type of searching for each field.

Thanks.