Collection.any() support for Collections module

Bug #667362 reported by Timo Westkämper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Medium
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 :

    @Before
    public void setUp(){
        Cat cat1 = new Cat("1");
        cat1.setKittens(Arrays.asList(cat1));
        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);
    }

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

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

    @Test
    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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.