I have inherited some code that I am trying to understand, and any search I do to find something on @SelectProvider has nothing to do.
Java DAO
@SelectProvider(type = CategoryDaoSelectProvider.class, method = "findByParentIdAndName") Category findByParentIdAndName(@Param("parentId") Long parentId, @Param("name") String name);
Choose a supplier
public class CategoryDaoSelectProvider { public static String findByParentIdAndName(Map<String, Object> params) { Long parentId = (Long)params.get("parentId");
What is the purpose of the parentId parameter in this code? As far as I can tell, it never does anything if in some magic way # {parentId} is replaced with a value. Is this parameter simply not used in this situation? Where mybatis actually inject the request?
source share