Thanks for your replies ... which could be helpful.
It would be nice if you could configure the alias naming strategy. At the moment it seems to be hard-coded into the source.
My workaround is to post process the SQL by removing the alias part from the column names
Code:
protected String getModified(String origSQL)
{
String sql = origSQL.toLowerCase();
int fromIndex = sql.indexOf("from");
sql = sql.substring(0, fromIndex);
StringBuffer t = new StringBuffer(sql.length());
int limit = 0; // index of current ?
int base = 0; // index of previous ?
while ((limit = sql.indexOf("as", limit)) != -1)
{
String substring = origSQL.substring(base, limit-1);
t.append(substring);
limit = sql.indexOf(",", limit);
if (limit == -1) break;
base = limit;
}
t.append(origSQL.substring(base));
return t.toString();
}
A bit of a hack but it seems to work so far, although I suspect I may run into problems later down the line with more advanced queries