[hibernate-dev] mixing named and positional parameters

Steve Ebersole steve at hibernate.org
Fri Sep 30 12:02:16 EDT 2016


The JPA spec specifically says:

<quote>
Either positional or named parameters may be used. Positional and named
parameters must not be mixed in a single query.
</quote>

I was thinking about how it does not make sense to mix these in a query
(its confusing) and went looking to see what, if anything, the spec had to
say on the subject.  Which is when I found that passage.

Currently we do not validate this one way or the other.  But I think we
ought to start.  The only real question is whether to make this an
exception all the time, or just when strict-JPA-compliance is requested.
Personally I vote for always disallowing this (like I said, I find it
confusing), but would like to get other's thoughts.


More information about the hibernate-dev mailing list