@Override
    public JPAQuery<T> clone(EntityManager entityManager, JPQLTemplates templates) {
        JPAQuery<T> q = new JPAQuery<T>(entityManager, templates, getMetadata().clone());
        q.clone(this);
        return q;
    }
Creates a new query

@param em entity manager
@param templates templates
@param metadata query metadata
querydsl-jpa/src/main/java/com/querydsl/jpa/impl/JPAQuery.java