Java: add a class for MyBatis Mapper methods that update a database

This commit is contained in:
Jami Cogswell
2024-11-26 21:14:32 -05:00
parent 506d668289
commit 8e9f21dc52

View File

@@ -27,3 +27,20 @@ private class SpringCsrfUnprotectedMethod extends CsrfUnprotectedMethod instance
)
}
}
/** A method that updates a database. */
abstract class DatabaseUpdateMethod extends Method { }
/** A MyBatis Mapper method that updates a database. */
private class MyBatisMapperDatabaseUpdateMethod extends DatabaseUpdateMethod {
MyBatisMapperDatabaseUpdateMethod() {
exists(MyBatisMapperSqlOperation mapperXml |
(
mapperXml instanceof MyBatisMapperInsert or
mapperXml instanceof MyBatisMapperUpdate or
mapperXml instanceof MyBatisMapperDelete
) and
this = mapperXml.getMapperMethod()
)
}
}