I'm setting up a workbench that runs a SQL query on an Oracle db (using SQL Executor) and converts it into an ESRI Shapefile. The workbench is dynamic; we have about 200 pre-defined SQL queries stored in a config file that is retrieved at runtime based on user input and stored in a parameter. I've got everything in the workbench set up and working fine; a user can pick which query they want to use, the SQL Executor will execute the appropriate query, Schema Setter will build a list of attributes based on the SQL Executor, and they will be written to the Shapefile.
The problem is the order in which the attributes appear seems to be completely random. If my SQL query is "select a, b, c, d, e, f ... from table" my resulting shapefile will show the attributes in something like e, d, f, a, c, b as opposed to the order in which they were queried. The order is the same each time so I guess it's not TOTALLY random, but I have no idea how it's getting the order it's getting.
Unfortunately, each SQL query we're using queries a different table and thus has different column names so this isn't something I can sort out in the writer. Alphabetical order is also not what I'm looking for. Is there any way to force SchemaSetter to return the list in the order that was set up by the SQL Query?