*/
private String rewriteEclipseLink(Query query) {
EJBQueryImpl qi = (EJBQueryImpl) query;
Session session = this.entityManager.unwrap(JpaEntityManager.class).getActiveSession();
DatabaseQuery databaseQuery = (qi).getDatabaseQuery();
databaseQuery.prepareCall(session, new DatabaseRecord());
String sqlString = databaseQuery.getTranslatedSQLString(session, new DatabaseRecord());
//ADD THE ALIAS in the select statement (necessary for the temporary table construction.. ex for the worksheet)
int fromPosition = sqlString.indexOf("FROM");
StringBuffer sqlQuery2 = new StringBuffer();