Collection.any() support for Collections module

Bug #667362 reported by Timo Westkämper on 2010-10-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Timo Westkämper

Bug Description

Make Collection.any() work in Querydsl Collections queries

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Related tests for examples :

    public void setUp(){
        Cat cat1 = new Cat("1");
        Cat cat2 = new Cat("2");
        cat2.setKittens(Arrays.asList(cat1, cat2));
        Cat cat3 = new Cat("3");
        cat3.setKittens(Arrays.asList(cat1, cat2, cat3));
        Cat cat4 = new Cat("4");
        cat4.setKittens(Arrays.asList(cat1, cat2, cat3, cat4));

        cats = Arrays.asList(cat1, cat2, cat3, cat4);

    public void Any_UniqueResult(){
        assertEquals("4", MiniApi.from(cat, cats).where(cat.kittens.any().name.eq("4")).uniqueResult(;

    public void Any_Count(){
        assertEquals(4, MiniApi.from(cat, cats).where(cat.kittens.any().name.isNotNull()).count());

    public void Any_Two_Levels(){
        assertEquals(4, MiniApi.from(cat, cats).where(cat.kittens.any().name.isNotNull(), cat.kittens.any().kittens.any().isNotNull()).count());

Changed in querydsl:
assignee: nobody → Timo Westkämper (timo-westkamper)
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.0.4

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers