forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyBatis.qll
More file actions
27 lines (24 loc) · 701 Bytes
/
MyBatis.qll
File metadata and controls
27 lines (24 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* Provides classes and predicates for working with the MyBatis framework.
*/
import java
/** The class `org.apache.ibatis.jdbc.SqlRunner`. */
class MyBatisSqlRunner extends RefType {
MyBatisSqlRunner() { this.hasQualifiedName("org.apache.ibatis.jdbc", "SqlRunner") }
}
/**
* Holds if `m` is a method on `MyBatisSqlRunner` taking an SQL string as its
* first argument.
*/
predicate mybatisSqlMethod(Method m) {
m.getDeclaringType() instanceof MyBatisSqlRunner and
m.getParameterType(0) instanceof TypeString and
(
m.hasName("delete") or
m.hasName("insert") or
m.hasName("run") or
m.hasName("selectAll") or
m.hasName("selectOne") or
m.hasName("update")
)
}