pathExpressionParser = new PathExpressionParser();
pathExpressionParser.setUseThetaStyleJoin( true ); //TODO: would be nice to use false, but issues with MS SQL
if ( q.isName( StringHelper.root( token ) ) ) {
ParserHelper.parse( pathExpressionParser, q.unalias( token ), ParserHelper.PATH_SEPARATORS, q );
q.appendOrderByToken( pathExpressionParser.getWhereColumn() );
pathExpressionParser.addAssociation( q );
}
else if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) { //named query parameter
q.addNamedParameter( token.substring( 1 ) );
q.appendOrderByToken( "?" );
}
else {
q.appendOrderByToken( token );
}