[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5754) setMaxResults limits a number of elements a criteria query returns for a collection of Embeddable objects

Vitaly Tsaplin (JIRA) noreply at atlassian.com
Tue Nov 23 18:51:13 EST 2010


setMaxResults limits a number of elements a criteria query returns for a collection of Embeddable objects
---------------------------------------------------------------------------------------------------------

                 Key: HHH-5754
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5754
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.6.0.CR2
            Reporter: Vitaly Tsaplin
            Priority: Critical


setMaxResults limits a number of elements a criteria query returns for a collection of Embeddable objects

@Entity
public class Product {

    ...

    private List<Picture> pictures;

    ...

    @ElementCollection(fetch=FetchType.EAGER)
    public List<Picture> getPictures() {
        return pictures;
    } 
}

  Product p = (Product)session.createCriteria(Product.class).setFirstResult(0).setMaxResults(1).list().iterator().next();

  p.getPictures().size() is always <=1


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list