Top "Criteria" questions

Mechanism typical to ORM frameworks that allows the creation of queries against a database in a dynamic and object-oriented fashion.

Getting a count of rows in a datatable that meet certain criteria

I have a datatable, dtFoo, and would like to get a count of the rows that meet a certain criteria. …

c# datatable count criteria
How to get distinct results in hibernate with joins and row-based limiting (paging)?

I'm trying to implement paging using row-based limiting (for example: setFirstResult(5) and setMaxResults(10)) on a Hibernate Criteria query that has …

java hibernate paging criteria distinct
Hibernate Criteria Join with 3 Tables

I am looking for a hibernate criteria to get following: Dokument.class is mapped to Role roleId Role.class has …

hibernate join criteria
JPA and Hibernate - Criteria vs. JPQL or HQL

What are the pros and cons of using Criteria or HQL? The Criteria API is a nice object-oriented way to …

java hibernate hql criteria hibernate-criteria
Hibernate Criteria Restrictions AND / OR combination

How would I achieve this using Hibernate Restrictions? (((A='X') and (B in('X',Y))) or ((A='Y') and (B=…

hibernate criteria hibernate-criteria restrictions
Hibernate Query By Example and Projections

To make it short: hibernate doesn't support projections and query by example? I found this post: The code is this: …

java hibernate criteria projection
How to properly express JPQL "join fetch" with "where" clause as JPA 2 CriteriaQuery?

Consider the following JPQL query: SELECT foo FROM Foo foo INNER JOIN FETCH foo.bar bar WHERE bar.baz = :baz …

java jpa criteria jpa-2.0
Hibernate Criteria for Dates

In oracle I have dates in format 17-April-2011 19:20:23.707000000 I would like to retrieve all orders for 17-04-2011. SimpleDateFormat formatter = …

java oracle hibernate jakarta-ee criteria
How to get SQL from Hibernate Criteria API (*not* for logging)

Is there a way to get the (to-be-generated) SQL from a Hibernate Criteria? Ideally, I would have something like: Criteria …

java sql hibernate criteria
How do I write a MAX query with a where clause in JPA 2.0?

I'm using JPA 2.0. Hibernate 4.1.0.Final, and Java 6. How do I write a JPA query from the following psuedo-SQL? select max(…

hibernate jpa jpa-2.0 max criteria