private AbstractClassMetaData getJoinClassMetaData(Expression expr, List<String> tuples,
QueryData qd) {
if (expr instanceof VariableExpression) {
// Change the class meta data to the meta-data for the joined class
if (qd.joinVariableExpression == null) {
throw new FatalNucleusUserException(
query.getSingleStringQuery()
+ ": Encountered a variable expression that isn't part of a join. Maybe you're "
+ "referencing a non-existent field of an embedded class.");
}
if (!((VariableExpression) expr).getId().equals(qd.joinVariableExpression.getId())) {
throw new FatalNucleusUserException(
query.getSingleStringQuery()
+ ": Encountered a variable (" + ((VariableExpression) expr).getId()
+ ") that doesn't match the join variable ("
+ qd.joinVariableExpression.getId() + ")");
}