justinmclean opened a new issue, #10270:
URL: https://github.com/apache/gravitino/issues/10270

   ### What would you like to be improved?
   
   Role deletion on the relational backend can reach 
RoleMetaMapper.softDeleteRoleMetaByRoleId(Long roleId) through the REST 
delete-role path. The provider SQL uses #{roleId}, but this mapper method 
currently lacks @Param("roleId"). That mismatch can cause MyBatis 
named-parameter binding failures at runtime during role deletion.
   
   ### How should we improve?
   
   Add @Param("roleId") to RoleMetaMapper.softDeleteRoleMetaByRoleId (and keep 
provider SQL as #{roleId}), ensuring deterministic named binding across 
environments.
   
   Here's a test to help:
   ```
    @Test
     public void testSoftDeleteRoleMetaByRoleIdHasNamedParam() throws 
NoSuchMethodException {
       Method method = 
RoleMetaMapper.class.getMethod("softDeleteRoleMetaByRoleId", Long.class);
       Annotation[][] parameterAnnotations = method.getParameterAnnotations();
   
       Assertions.assertEquals(1, parameterAnnotations.length);
       Param param = null;
       for (Annotation annotation : parameterAnnotations[0]) {
         if (annotation instanceof Param) {
           param = (Param) annotation;
           break;
         }
       }
   
       Assertions.assertNotNull(
           param, "Missing @Param on softDeleteRoleMetaByRoleId may break 
MyBatis named binding.");
       Assertions.assertEquals("roleId", param.value());
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to