/**
* @return The name of the sort property that was added to the primary
* datastore query.
*/
String getSortProperty(QueryData qd, Expression expr) {
OrderExpression oe = (OrderExpression) expr;
PrimaryExpression left = (PrimaryExpression) oe.getLeft();
AbstractClassMetaData acmd = qd.acmd;
List<String> tuples = getTuples(left, qd.compilation.getCandidateAlias());
if (isJoin(left.getLeft(), tuples)) {
// Change the class meta data to the meta-data for the joined class
acmd = getJoinClassMetaData(left.getLeft(), tuples, qd);