Code examples for Criteria

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.
67:	@Test 
68:	public void testGetCriteria() 
69:	{ 
-
73:	oneOf(hibernateSession).createCriteria(DomainGroup.class); 
-
77:	Criteria result = sut.getCriteria(hibernateSession); 
Full Snippet Info
8
CodeRank
67:	criteria.setProjection(fields); 
68:	criteria.createAlias("createdBy", "cb"); 
69:	criteria.createAlias("streamScope", "stream"); 
-
73:	criteria.add(Restrictions.eq("isPending", false)); 
-
77:	criteria.setResultTransformer(resultTransformer); 
Full Snippet Info
8
CodeRank
57:	criteria.setProjection(null); 
58:	criteria.setResultTransformer(Criteria.ROOT_ENTITY); 
-
61:	criteria.setFirstResult(firstResult.intValue()); 
-
65:	criteria.setMaxResults(maxResults.intValue()); 
-
69:	List<T> list = criteria.list(); 
Full Snippet Info
7
CodeRank
78:	 
79:	context.assertIsSatisfied(); 
Full Snippet Info
7
CodeRank
146:	int totalCount = ((Number) crit.setProjection(Projections.rowCount()) 
-
155:	crit.setProjection(projection); 
-
157:	crit.setResultTransformer(CriteriaSpecification.ROOT_ENTITY); 
-
160:	crit.setResultTransformer(transformer); 
-
168:	crit.setFirstResult(p.getFirstResult()); 
169:	crit.setMaxResults(p.getPageSize()); 
170:	p.setList(crit.list()); 
Full Snippet Info
7
CodeRank
94:	List list = _criteria.list(); 
Full Snippet Info
7
CodeRank
78:	criteria.setProjection(fields); 
79:	criteria.createAlias("streamScope", "stream"); 
-
83:	criteria.setResultTransformer(resultTransformer); 
Full Snippet Info
7
CodeRank
618:	Assert.notNull(criteria, "No Criteria object specified"); 
-
623:	criteria.setTimeout(sessionHolder.getTimeToLiveInSeconds()); 
Full Snippet Info
6
CodeRank
72:	when(criteria.list()).thenReturn(deletedVersions); 
73:	when(session.createCriteria(XWikiDeletedDocument.class)).thenReturn(criteria); 
-
79:	verify(criteria).add(argThat(new HasToString<SimpleExpression>(equalTo("fullName=Space.Page")))); 
80:	verify(criteria).add(argThat(new HasToString<SimpleExpression>(equalTo("language=ro")))); 
81:	verify(criteria).addOrder(argThat(new HasToString<Order>(equalTo("date desc")))); 
Full Snippet Info
6
CodeRank
45:	cb.addOrder(Order.asc("name")); 
46:	return (List<Member>) cb.list(); 
Full Snippet Info
7
CodeRank
64:	cb.addOrder(Order.asc("name")); 
65:	members = (List<Member>) cb.list(); 
Full Snippet Info
7
CodeRank
59:	criteria.add(Restrictions.idEq(id)); 
60:	return criteria.uniqueResult(); 
Full Snippet Info
6
CodeRank
59:	criteria.add(Restrictions.idEq(id)); 
60:	return criteria.uniqueResult(); 
Full Snippet Info
6
CodeRank
160:	criteria.setMaxResults( 1 ); 
161:	return ( (List<T>) criteria.list() ).get( 0 ); 
Full Snippet Info
6
CodeRank
86:	c.add(Restrictions.idEq(id)); 
87:	return (T)c.uniqueResult(); 
Full Snippet Info
6
CodeRank
87:	c.add(Restrictions.idEq(id)); 
88:	return (T)c.uniqueResult(); 
Full Snippet Info
6
CodeRank
70:	crit.add(Restrictions.eq("title", value)); 
-
72:	crit.add(Restrictions.eq("contentUrl", value)); 
-
74:	return crit.list().size() > 0 ? true : false; 
Full Snippet Info
5
CodeRank
54:	final Criteria newSearchCriteria = ongoingCriteria.createCriteria("categories"); 
-
57:	newSearchCriteria.add(Restrictions.in("term", inclusionTerms)); 
Full Snippet Info
5
CodeRank
86:	return (E) requireNonNull(criteria).uniqueResult(); 
Full Snippet Info
4
CodeRank