Change clone() to copy all state

This commit is contained in:
Ruben Dijkstra 2014-12-04 21:14:14 +01:00
parent 3f2ca5ccad
commit 9c093a4d61

View File

@ -357,7 +357,7 @@ public abstract class AbstractJPAQuery<Q extends AbstractJPAQuery<Q>> extends JP
/**
* Clone the state of this query to a new instance with the given EntityManager
* using the specified templates
* and the specified templates
*
* @param entityManager
* @param templates
@ -371,12 +371,7 @@ public abstract class AbstractJPAQuery<Q extends AbstractJPAQuery<Q>> extends JP
* @return
*/
public Q clone() {
JPQLTemplates existingTemplates = getTemplates();
if (existingTemplates != null) {
return clone(entityManager, existingTemplates);
}else {
return clone(entityManager);
}
return clone(entityManager, getTemplates());
}
}