@Override
    public String toString() {
        if (!queryMixin.getMetadata().getJoins().isEmpty()) {
            SQLSerializer serializer = new SQLSerializer(configuration);
            serializer.serialize(queryMixin.getMetadata(), false);
            return serializer.toString().trim();
        } else {
            return super.toString();
        }
    }
Close the query and related resources
querydsl-jdo/src/main/java/com/querydsl/jdo/sql/AbstractSQLQuery.java