Join GitHub today
Default template of JPAQueryFactory differs from one provided by JPAQuery #398
#72 started for some reason to haunt me again and I figured out that JPAQueryFactory and JPAQuery constructors are not coherent on what templates to use as default. JPAQueryFactory always resolutes to JPQL standard template whereas JPAQuery is smart enough to seek advice from entity manager.
I think that the best solution would be to postpone choosing of default template until entity manager is available. As a side note I also noticed that JPAQuery#clone is still forgetting to tag along the chosen template (mentioned in the referenced issue).
added a commit
Apr 17, 2013
clone takes the JPQLTemplates variant that fits best the given EntityManager
Since clone is meant to be used for detached queries, this IMHO makes sense.
Here is the commit where this change happened 69ea056
Thanks for the clarification,
I didn't think the cloning issue though I guess, sorry about that. Now there's only the main issue and here's a patch for it.