Top "Named-query" questions

A Hibernate (and NHibernate) feature that allows for both HQL and SQL queries to be written in the mapping document, keyed by a name.

JPA setParameter when dealing with "NOT IN (:param)"

I'm trying to set a parameter in my query, for example: select * from Cars where Cars.color NOT IN (:color_…

java jpa named-query
Can I use SQL's IN(...) statement for a namedQuery?

How can I use IN at my namedQuery? @NamedQueries( { @NamedQuery(name = "GetAvailableProducts", query = new StringBuilder("").append("SELECT p FROM Product …

java sql named-query
Return value of JPA query when no matches found

I'm using Spring JPA named querys in my repository. My problem is, that I can't find anywhere information what would …

java spring-boot spring-data-jpa named-query
Named query with input parameter

I am learning JPA with Hibernate, using maven as well. My problem is How can I use input parameters with …

jpa named-query
MappingException: Named query not known

Trying to learn Hibernate, i am trying to learn how to execute NamedQuries but evertime i am getting Exception in …

java hibernate jpa hibernate-mapping named-query
NamedQuery: IllegalArgumentException (Query not found) after externalizing entities

I have successfully used javax.persistence.NamedQuery in combination with JPA2. The named queries are defined at the top of …

jpa ejb named-query
JPA Named Queries vs Criteria API?

Is there a heuristic/best practice/ruleset for a decision between the Criteria API and NamedQuery? My thoughts so far : …

java jpa criteria-api named-query
Parameter named query testing with mockito

I want to write a Junit test for my dao, but I have a problem. Here is the method I …

java jpa junit mockito named-query
JPQL query with WHERE on nested fields

I have a java entity class UserBean with a list of events: @OneToMany private List<EventBean> events; EventBean …

jpa eclipselink jpql named-query
JPA: select random row

This is my JPA ENTITY @Entity @NamedQueries({ @NamedQuery(name = "Question.randQuestion", query = "SELECT q FROM Question AS q ORDER BY …

java jpa jpql named-query