Hibernate: could not locate named parameter
Today I got this exception. Pretty obvious? Well, no. The named parameter IS there. (Sidenote: this exception generally means that when trying to call setParameter(..)
with a certain param name, that name is not found in the query, in the form :paramName
)
The query is generated dynamically on different entities. And it works, except for one.
And that “one” turned out NOT to be an @Entity
. But Hibernate wasn’t too helpful on that.
So to summarize, when you attempt to make a query on a non-entity, Hibernate will not complain that it is not an entity – it will complain about other things.
Today I got this exception. Pretty obvious? Well, no. The named parameter IS there. (Sidenote: this exception generally means that when trying to call setParameter(..)
with a certain param name, that name is not found in the query, in the form :paramName
)
The query is generated dynamically on different entities. And it works, except for one.
And that “one” turned out NOT to be an @Entity
. But Hibernate wasn’t too helpful on that.
So to summarize, when you attempt to make a query on a non-entity, Hibernate will not complain that it is not an entity – it will complain about other things.
Thanks 🙂 It was helpful 🙂
Thanks It was helpful!!!!