@Override
    public List<JoinExpression> getJoins() {
        if (joins == null) {
            joins = new ArrayList<>();
            int separator = 0;
            for (JoinExpression j : super.getJoins()) {
                if (j.getType() == JoinType.DEFAULT) {
                    joins.add(separator++, j);
                } else {
                    joins.add(j);
                }
            }
        }
        return joins;
    }
{@code OrderedQueryMetadata} performs no metadata validation and ensures that FROM elements are before
JOIN elements

@author tiwe
querydsl-core/src/main/java/com/querydsl/core/support/OrderedQueryMetadata.java