|
I've attempted to debug my way into the Hibernate code and have found that the ImpliedFromElement within the first sub-query does temporarily have its 'text' instance variable set correctly to 'MEMBER members1_'. However, later in the process, a method in FromElementFactory called 'createCollectionJoin' is apparently dealing with the favoriteColors collection for the inner sub-query and does this:
private FromElement createCollectionJoin(JoinSequence collectionJoinSequence, String tableAlias) throws SemanticException
{
String text = this.queryableCollection.getTableName();
AST ast = createFromElement(text);
FromElement destination = (FromElement)ast;
Type elementType = this.queryableCollection.getElementType();
if (elementType.isCollectionType()) {
throw new SemanticException("Collections of collections are not supported!");
}
destination.initializeCollection(this.fromClause, this.classAlias, tableAlias);
destination.setType(139);
destination.setIncludeSubclasses(false);
destination.setCollectionJoin(true);
destination.setJoinSequence(collectionJoinSequence);
destination.setOrigin(this.origin, false);
destination.setCollectionTableAlias(tableAlias);
this.origin.setText("");
this.origin.setCollectionJoin(true);
this.fromClause.addCollectionJoinFromElementByPath(this.path, destination);
this.fromClause.getWalker().addQuerySpaces(this.queryableCollection.getCollectionSpaces());
return destination;
}
Note the following line:
this.origin refers to the ImpliedFromElement that previously has text="MEMBER members1_". This code sets it to an empty String, which ultimately leads to the problem when it is later rendered. If I remove this line, it solves the problem, but I've no idea what implications that has for anything else!
Can anyone familiar with this code comment?
|