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

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

Hibernate ORM Criteria examples from Open Source projects
This code example shows how to use the following methods: add, createAlias, setProjection, setResultTransformer
67:	@Test 
68:	public void testGetCriteria() 
69:	{ 
-
73:	oneOf(hibernateSession).createCriteria(DomainGroup.class); 
-
77:	Criteria result = sut.getCriteria(hibernateSession); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: add, createAlias, setProjection, setResultTransformer
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
This code example shows how to use the following methods: list, setFirstResult, setMaxResults, setProjection, setResultTransformer
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
This code example shows how to use the following methods: createAlias, setProjection, setResultTransformer
78:	 
79:	context.assertIsSatisfied(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: list, setFirstResult, setMaxResults, setProjection, setResultTransformer
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
This code example shows how to use the following methods: list
94:	List list = _criteria.list(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: createAlias, setProjection, setResultTransformer
78:	criteria.setProjection(fields); 
79:	criteria.createAlias("streamScope", "stream"); 
-
83:	criteria.setResultTransformer(resultTransformer); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTimeout
618:	Assert.notNull(criteria, "No Criteria object specified"); 
-
623:	criteria.setTimeout(sessionHolder.getTimeToLiveInSeconds()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: list
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
This code example shows how to use the following methods: addOrder, list
45:	cb.addOrder(Order.asc("name")); 
46:	return (List<Member>) cb.list(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addOrder, list
64:	cb.addOrder(Order.asc("name")); 
65:	members = (List<Member>) cb.list(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: add, uniqueResult
59:	criteria.add(Restrictions.idEq(id)); 
60:	return criteria.uniqueResult(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add, uniqueResult
59:	criteria.add(Restrictions.idEq(id)); 
60:	return criteria.uniqueResult(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: list, setMaxResults
160:	criteria.setMaxResults( 1 ); 
161:	return ( (List<T>) criteria.list() ).get( 0 ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add, uniqueResult
86:	c.add(Restrictions.idEq(id)); 
87:	return (T)c.uniqueResult(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add, uniqueResult
87:	c.add(Restrictions.idEq(id)); 
88:	return (T)c.uniqueResult(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add, list
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
This code example shows how to use the following methods: add, createCriteria
54:	final Criteria newSearchCriteria = ongoingCriteria.createCriteria("categories"); 
-
57:	newSearchCriteria.add(Restrictions.in("term", inclusionTerms)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list
136:	List<T> result = crit.list(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: add, list
79:	criteria.add ( tplCriterion ); 
-
81:	return criteria.list (); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setProjection
28:	return ((Integer)(criteria.setProjection(Projections.rowCount()).uniqueResult())).intValue(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: list
101:	return c.list(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: add, setResultTransformer
68:	c.setResultTransformer( Criteria.DISTINCT_ROOT_ENTITY ); 
-
73:	c.add( completed ); 
-
79:	c.add( dueQuery ); 
-
85:	c.add( updatedDateQuery ); 
-
91:	c.add( createdDateQuery ); 
-
97:	c.add( completedDateQuery ); 
-
102:	c.add( Restrictions.eq( "name.project", project ) ); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setProjection, setResultTransformer
57:	this.cloneCriteria.setProjection(Projections.rowCount()); 
58:	this.cloneCriteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: add, addOrder, createAlias
86:	crit.createAlias(RasdManagement.RASD_PROPERTY, "rasd"); 
-
89:	crit.add(Restrictions.in(RasdManagement.ID_RESOURCE_TYPE_PROPERTY, new String[] { 
-
93:	crit.add(sameVirtualMachine(virtualMachine)); 
-
96:	crit.addOrder(Order.asc("sequence")); 
-
98:	return getResultList(crit); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAlias
This code example shows how to use the following methods: add
175:	criteria.add(Restrictions.ge("day", init)); 
-
178:	criteria.add(Restrictions.le("day", end)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setMaxResults
103:	return criteria.setMaxResults(maxResults).setFirstResult(firstResult).list(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: add, addOrder, list
69:	return criteria.list(); 
-
116:	criteria.add(Restrictions.eq("tv.thesaurus.identifier", 
-
130:	criteria.addOrder(Order.desc(sortColumn)); 
Full Snippet Info
4
CodeRank
See Code Examples for Hibernate ORM Criteria Methods: