-2
I have a "Request" entity with a task list (another entity) and need to use speciffication to filter the requested entity and the nested task list.
Example: Select * Order where tarrefa.finalizada = "S"
I need to return a list of orders and tasks that have been performed.
My problem is the nested list, specffication filters the only entity Request and not the task list.
Code:
`
public static Specification<UsuarioProcesso> porFinalzada(Indicador finalizada){
return new JoinableSpecification<>() {
@Override
public Predicate toPredicate(Root<UsuarioProcesso> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
Path<Indicador> path = this.joinList(root, UsuarioProcesso_.tarefas, JoinType.INNER).get(UsuarioProcessoTarefa_.finalizada);
return cb.equal(path, finalizada);
}
};
}
`