Question

Having this bean structure

class User {
    private List<Permission> permissions;
    ...
}

class Permission {
    private Detail detail;
    ...
}

class Detail {
    private String name;
    ...
}

How can I filter list of users to contain only users with at least one permission with Permission.Detail.name containing string "abc"?

Was it helpful?

Solution

Ok, I found it

select(
        values,
        having(
                on(User.class).gePpermissions(), 
                hasItem(
                        having(
                                on(Permission.class).getDetail().getName(), 
                                containsString("abc")
                        )
                )
        )
);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top