Best code examples for Hibernate ORM Query class (org.hibernate.Query)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM Query class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM Query examples from Open Source projects
This code example shows how to use the following methods: list, setFirstResult, setMaxResults
106:	query.setFirstResult(offset); 
107:	query.setMaxResults(limit); 
108:	return (List<T>)query.list(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setFetchSize
54:	when(session.createQuery("testQuery")).thenReturn(scrollableResults); 
55:	when(scrollableResults.setFetchSize(0)).thenReturn(scrollableResults); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: list
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
This code example shows how to use the following methods: setTimeout
600:	Assert.notNull(query, "No Query object specified"); 
-
605:	query.setTimeout(sessionHolder.getTimeToLiveInSeconds()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: list
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
This code example shows how to use the following methods: list
98:	List<Foo> actualFoos = query.list(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: list, setFirstResult, setMaxResults, setParameter
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
This code example shows how to use the following methods: list
105:	addInitAndEndParameters(query, initInclusive, endInclusive); 
106:	addResourceParameter(query, resource); 
107:	return query.list(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setFirstResult, setMaxResults
37:	qu.setMaxResults(pageSize); 
38:	qu.setFirstResult((pageIndex - 1) * pageSize); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: list, setParameter
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
This code example shows how to use the following methods: executeUpdate, setString
172:	qry.setString("roleId", roleId); 
173:	qry.setString("domainId", domainId); 
174:	qry.setString("userId", userId); 
175:	qry.executeUpdate(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: scroll, setFirstResult, setMaxResults
60:	query.setFirstResult(offset); 
61:	query.setMaxResults(MAX_QUERY_ROWS); 
62:	return query.scroll(ScrollMode.FORWARD_ONLY); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setParameter, uniqueResult
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
This code example shows how to use the following methods: list, setFirstResult, setMaxResults
89:	q.setFirstResult(s); 
-
92:	q.setMaxResults(rows); 
-
95:	return q.list(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setString, uniqueResult
77:	query.setString(0, id.toString()); 
78:	PrdCategoryStatusEntity prdCategoryStatusEntity = (PrdCategoryStatusEntity) query.uniqueResult(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: scroll, setFetchSize, setResultTransformer
77:	q.setFetchSize(100); 
78:	q.setResultTransformer(new ResultTransformer() { 
-
94:	ScrollableResults sr = q.scroll(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list
123:	return q.list(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: scroll, setFetchSize
60:	query.setFetchSize(Integer.MIN_VALUE); 
61:	return query.scroll(ScrollMode.FORWARD_ONLY); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list, setString
120:	qry.setString("group", group); 
121:	qry.setString("defId", defId); 
122:	List<PolicyDefParam> result = (List<PolicyDefParam>) qry.list(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list, setString
110:	qry.setString("level", level); 
111:	qry.setString("value", value); 
112:	List<PolicyObjectAssoc> results = (List<PolicyObjectAssoc>)qry.list(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list, setCacheRegion, setCacheable
111:	qry.setCacheable(true); 
112:	qry.setCacheRegion("query.orgPolicy.getAllPolicyMessages"); 
-
114:	List<OrgPolicy> results = (List<OrgPolicy>)qry.list(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: executeUpdate, setString
131:	qry.setString("serviceId", serviceId); 
132:	qry.setString("roleId",roleId); 
133:	qry.executeUpdate(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: executeUpdate, setString
144:	qry.setString("orgId", orgId); 
145:	qry.setString("userId", userId); 
146:	qry.executeUpdate(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setParameter
64:	query.setParameter("bundle", bundle); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list, setString
195:	qry.setString("catId", categoryId); 
196:	List<MetadataType> results = (List<MetadataType>) qry.list(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: executeUpdate, setString
124:	qry.setString("parentId", parentId); 
125:	return qry.executeUpdate(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: iterate
64:	return ((Number) query.iterate().next()).intValue(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: executeUpdate, setParameter
55:	query.setParameter("roleid", roleid); 
56:	i = query.executeUpdate(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setCacheRegion, setCacheable, setString
358:	q.setCacheRegion("foo"); 
359:	q.setCacheable(true); 
360:	q.setString("name", "Simple 1"); 
-
364:	q.setString("name", "Simple 2"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: scroll
72:	ScrollableResults scrollableResults = query.scroll(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list
69:	q.list(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: executeUpdate, setString
132:	qry.setString("userId", userId); 
133:	qry.executeUpdate(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list, setString
112:	qry.setString("userId", userId); 
113:	List<OrgPolicyUserLog> results = (List<OrgPolicyUserLog>)qry.list(); 
Full Snippet Info
5
CodeRank
See Code Examples for Hibernate ORM Query Methods: