if (stateObject.isDecorated()) {
toText(stateObject);
}
else {
Join expression = stateObject.getExpression();
// JOIN
appendIdentifier((expression != null) ? expression.getActualIdentifier() : stateObject.getJoinType(), stateObject.getJoinType());
if (shouldOutput(expression) || expression.hasSpaceAfterJoin()) {
writer.append(SPACE);
}
// Join association path
stateObject.getJoinAssociationPathStateObject().accept(this);
// Check first if the JOIN FETCH is allowed to have an identification variable
if (stateObject.hasFetch()) {
if (expression.hasAs()) {
writer.append(SPACE);
}
}
// JOIN always needs a whitespace
else {
if (shouldOutput(expression) || expression.hasSpaceAfterJoinAssociation()) {
writer.append(SPACE);
}
}
// AS
if (stateObject.hasAs()) {
appendIdentifier((expression != null) ? expression.getActualAsIdentifier() : AS, AS);
if (shouldOutput(expression) || expression.hasSpaceAfterAs()) {
writer.append(SPACE);
}
}
// Identification variable