Frage

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"?

War es hilfreich?

Lösung

Ok, I found it

select(
        values,
        having(
                on(User.class).gePpermissions(), 
                hasItem(
                        having(
                                on(Permission.class).getDetail().getName(), 
                                containsString("abc")
                        )
                )
        )
);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top