There is a problem when using multiple join expressions. It occurs when using a query like "Select d From Department d Join d.projects p Join d.manager m". The bug takes place, while traversing the join expressions. When the first join is evaluated, the ClassMetadata from the joined Entity (in this case Project) is loaded. When evaluating the next join expression, the ClassMetadata is not updated, thus it is tried to access a field with name manager of class Project (instead of the correct class Department), resulting in an PersistenceException: Query has d.manager yet manager is not found. Fix your input
I extended the DataNucleus test suite with this simple query and I implemented a quick fix. I only use JPA, I cannot tell whether this occurs with JDO also.