bodyBuilder.appendFormalLine("String jpaQuery = \"SELECT o FROM " + entityName + " o\";");
bodyBuilder.appendFormalLine("if (fieldNames4OrderClauseFilter.contains(sortFieldName)) {");
bodyBuilder.indent();
bodyBuilder.appendFormalLine("jpaQuery = jpaQuery + \" ORDER BY \" + sortFieldName;");
bodyBuilder.appendFormalLine("if (\"ASC\".equalsIgnoreCase(sortOrder) || \"DESC\".equalsIgnoreCase(sortOrder)) {");
bodyBuilder.indent();
bodyBuilder.appendFormalLine("jpaQuery = jpaQuery + \" \" + sortOrder;");
bodyBuilder.indentRemove();
bodyBuilder.appendFormalLine("}");
bodyBuilder.indentRemove();
bodyBuilder.appendFormalLine("}");