Issue Type: Bug Bug
Affects Versions: 3.6.10
Assignee: Unassigned
Components: query-criteria
Created: 09/Jul/12 3:15 AM
Description:

For example we have simple class:

@Entity
@Table(name = "REQUESTS")
public class Request { @Id @GeneratedValue public Long id; @ManyToOne @JoinColumn(name = "USER_ID", nullable = false) public User user; }

And there are several rows (e.g. <N> rows) with "USER_ID = null" in table "REQUESTS". Number of rows with not null "USER_ID" is <L> (e.g.) In this case:

Criteria criteria = session.createCriteria(Request.class);
criteria.setProjection(Projections.rowCount());
Number result = (Number) criteria.uniqueResult();

// result == N+L

and
Criteria criteria = session.createCriteria(Request.class);
List list = criteria.list();

// list.size() == L !!!

i.e. rowCount > actual list size.

Environment: IBM DB2 database
Project: Hibernate ORM
Priority: Major Major
Reporter: Andremoniy
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira