Code examples for Query

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
106:	query.setFirstResult(offset); 
107:	query.setMaxResults(limit); 
108:	return (List<T>)query.list(); 
Full Snippet Info
7
CodeRank
54:	when(session.createQuery("testQuery")).thenReturn(scrollableResults); 
55:	when(scrollableResults.setFetchSize(0)).thenReturn(scrollableResults); 
Full Snippet Info
7
CodeRank
101:	when(session.createQuery(anyString())).thenReturn(query); 
102:	when(query.list()).thenReturn(listResult); 
-
118:	verify(query).setParameter(eq("key1"), eq("value1")); 
119:	verify(query).setParameter(eq("key2"), eq("value2")); 
120:	verify(query).list(); 
Full Snippet Info
7
CodeRank
600:	Assert.notNull(query, "No Query object specified"); 
-
605:	query.setTimeout(sessionHolder.getTimeToLiveInSeconds()); 
Full Snippet Info
7
CodeRank
372:	when(session.createQuery(statement)).thenReturn(query); 
373:	when(query.list()).thenReturn(Collections.singletonList(fullName)); 
-
377:	verify(query).setString("fullName", fullName); 
378:	verify(query).setString("language", Locale.ENGLISH.toString()); 
Full Snippet Info
6
CodeRank
98:	List<Foo> actualFoos = query.list(); 
Full Snippet Info
6
CodeRank
119:	expect(session.createQuery("Select e from EmailTemplate e where id = ?")).andReturn(query); 
120:	expect(query.setParameter(0, "fakeValue")).andReturn(query); 
121:	expect(query.setFirstResult(0)).andReturn(query); 
122:	expect(query.setMaxResults(10)).andReturn(query); 
123:	expect(query.list()).andReturn(expectedTemplates); 
Full Snippet Info
6
CodeRank
105:	addInitAndEndParameters(query, initInclusive, endInclusive); 
106:	addResourceParameter(query, resource); 
107:	return query.list(); 
Full Snippet Info
6
CodeRank
186:	query.setParameter("pageid", pageid); 
187:	query.setParameter("typeid", typeid); 
188:	query.setParameter("state", state); 
189:	List list = query.list(); 
Full Snippet Info
6
CodeRank
60:	query.setFirstResult(offset); 
61:	query.setMaxResults(MAX_QUERY_ROWS); 
62:	return query.scroll(ScrollMode.FORWARD_ONLY); 
Full Snippet Info
6
CodeRank
128:	+ "  left join e.allRights vr left join e.tags t" + "  where e.headline like ?")).andReturn( 
-
130:	expect(query.setParameter(0, "foobar")).andReturn(query); 
131:	expect(query.uniqueResult()).andReturn(2l); 
Full Snippet Info
6
CodeRank
89:	q.setFirstResult(s); 
-
92:	q.setMaxResults(rows); 
-
95:	return q.list(); 
Full Snippet Info
6
CodeRank
100:	return (E) requireNonNull(query).uniqueResult(); 
Full Snippet Info
4
CodeRank