For example, I have helper class with Specifications. Here is the example of one:
public static Specification<Player> filterByName(String name) {
return ((root, query, criteriaBuilder) ->
name == null ? null : criteriaBuilder.like(root.get("name"), "%" + name + "%"));
}
I use them later to call Repository. I don't understand how objects of root, query, criteriaBuiler "appear" in he method above if the are not being created by me.
I do appreciate your answer a lot!