Source:
public void processJoins(QueryNode query) { final FromClause fromClause = query.getFromClause(); Map<String, Object> properties = walker.getSessionFactoryHelper().getFactory().getProperties(); Set<String> queryReferencedTables = findQueryReferencedTables( query ); final List fromElements; if ( DotNode.useThetaStyleImplicitJoins ) { fromElements = new ArrayList(); ListIterator liter = fromClause.getFromElements().listIterator( fromClause.getFromElements().size() ); while ( liter.hasPrevious() ) { fromElements.add( liter.previous() ); } } else { fromElements = new ArrayList( fromClause.getFromElements().size() ); ListIterator<FromElement> liter = fromClause.getFromElements().listIterator(); while ( liter.hasNext() ) { FromElement fromElement = liter.next(); if ( fromElement instanceof ImpliedFromElement && fromElement.getOrigin().getWithClauseFragment() != null && fromElement.getOrigin().getWithClauseFragment().contains( fromElement.getTableAlias() ) ) { fromElement.getOrigin().getJoinSequence().addJoin( (ImpliedFromElement) fromElement ); fromElement.setText( "" ); } else { fromElements.add( fromElement ); } } } Iterator iter = fromElements.iterator(); while ( iter.hasNext() ) { final FromElement fromElement = (FromElement) iter.next(); JoinSequence join = fromElement.getJoinSequence(); join.setQueryReferencedTables( queryReferencedTables ); join.setSelector( new JoinSequence.Selector() { public boolean includeSubclasses(String alias) { boolean containsTableAlias = fromClause.containsTableAlias( alias ); if ( fromElement.isDereferencedBySubclassProperty() ) { LOG.tracev( "Forcing inclusion of extra joins [alias={0}, containsTableAlias={1}]", alias, containsTableAlias ); return true; } boolean shallowQuery = walker.isShallowQuery(); boolean includeSubclasses = fromElement.isIncludeSubclasses(); boolean subQuery = fromClause.isSubQuery(); return includeSubclasses && containsTableAlias && !subQuery && !shallowQuery; } } ); addJoinNodes( query, join, fromElement ); } }

Target:
public void processJoins(QueryNode query) { final FromClause fromClause = query.getFromClause(); Set<String> queryReferencedTables = findQueryReferencedTables( query ); final List fromElements; if ( DotNode.useThetaStyleImplicitJoins ) { fromElements = new ArrayList(); ListIterator liter = fromClause.getFromElements().listIterator( fromClause.getFromElements().size() ); while ( liter.hasPrevious() ) { fromElements.add( liter.previous() ); } } else { fromElements = new ArrayList( fromClause.getFromElements().size() ); ListIterator<FromElement> liter = fromClause.getFromElements().listIterator(); while ( liter.hasNext() ) { FromElement fromElement = liter.next(); if ( fromElement instanceof ImpliedFromElement && fromElement.getOrigin().getWithClauseFragment() != null && fromElement.getOrigin().getWithClauseFragment().contains( fromElement.getTableAlias() ) ) { fromElement.getOrigin().getJoinSequence().addJoin( (ImpliedFromElement) fromElement ); fromElement.setText( "" ); } else { fromElements.add( fromElement ); } } } Iterator iter = fromElements.iterator(); while ( iter.hasNext() ) { final FromElement fromElement = (FromElement) iter.next(); JoinSequence join = fromElement.getJoinSequence(); join.setQueryReferencedTables( queryReferencedTables ); join.setSelector( new JoinSequence.Selector() { public boolean includeSubclasses(String alias) { boolean containsTableAlias = fromClause.containsTableAlias( alias ); if ( fromElement.isDereferencedBySubclassProperty() ) { LOG.tracev( "Forcing inclusion of extra joins [alias={0}, containsTableAlias={1}]", alias, containsTableAlias ); return true; } boolean shallowQuery = walker.isShallowQuery(); boolean includeSubclasses = fromElement.isIncludeSubclasses(); boolean subQuery = fromClause.isSubQuery(); return includeSubclasses && containsTableAlias && !subQuery && !shallowQuery; } } ); addJoinNodes( query, join, fromElement ); } }