(elemType: string, attrs: string, isSqlFragment: boolean)
| 255 | } |
| 256 | |
| 257 | private buildSignature(elemType: string, attrs: string, isSqlFragment: boolean): string { |
| 258 | if (isSqlFragment) return '<sql>'; |
| 259 | const verb = elemType.toUpperCase(); |
| 260 | const result = /\bresultType\s*=\s*(["'])([^"']+)\1/.exec(attrs)?.[2]; |
| 261 | const param = /\bparameterType\s*=\s*(["'])([^"']+)\1/.exec(attrs)?.[2]; |
| 262 | // A vendor-split statement carries `databaseId`; surface it so the two |
| 263 | // otherwise-identical `<namespace>::<id>` nodes are distinguishable. |
| 264 | const dbId = /\bdatabaseId\s*=\s*(["'])([^"']+)\1/.exec(attrs)?.[2]; |
| 265 | const parts = [verb]; |
| 266 | if (param) parts.push(`param=${param}`); |
| 267 | if (result) parts.push(`result=${result}`); |
| 268 | if (dbId) parts.push(`databaseId=${dbId}`); |
| 269 | return parts.join(' '); |
| 270 | } |
| 271 | |
| 272 | /** |
| 273 | * Build the `<namespace>::<id>` qualified name the MyBatis synthesizer |
no test coverage detected