/** * Clone the state of this query to a new JPAQuery instance with the given EntityManager * * @param entityManager * @return */ public JPAQuery clone(EntityManager entityManager) { JPAQuery q = new JPAQuery(entityManager, JPAProvider.getTemplates(entityManager), getMetadata().clone()); q.projection = projection; q.flushMode = flushMode; q.hints.putAll(hints); q.lockMode = lockMode; return q; }
/** * Creates a new EntityManager bound query * * @param em */ public JPAQuery(EntityManager em, QueryMetadata metadata) { super(em, JPAProvider.getTemplates(em), metadata); }
/** * Creates a new EntityManager bound query * * @param em */ public JPAQuery(EntityManager em) { super(em, JPAProvider.getTemplates(em), new DefaultQueryMetadata()); }