• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mybatis / generator / 2202

05 May 2026 07:27PM UTC coverage: 91.746% (+0.04%) from 91.703%
2202

push

github

web-flow
Merge pull request #1508 from mybatis/renovate/com.github.javaparser-javaparser-core-3.x

Update dependency com.github.javaparser:javaparser-core to v3.28.1

2454 of 3154 branches covered (77.81%)

12038 of 13121 relevant lines covered (91.75%)

0.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

99.1
/core/mybatis-generator-core/src/main/java/org/mybatis/generator/api/Plugin.java
1
/*
2
 *    Copyright 2006-2026 the original author or authors.
3
 *
4
 *    Licensed under the Apache License, Version 2.0 (the "License");
5
 *    you may not use this file except in compliance with the License.
6
 *    You may obtain a copy of the License at
7
 *
8
 *       https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *    Unless required by applicable law or agreed to in writing, software
11
 *    distributed under the License is distributed on an "AS IS" BASIS,
12
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *    See the License for the specific language governing permissions and
14
 *    limitations under the License.
15
 */
16
package org.mybatis.generator.api;
17

18
import java.util.Collections;
19
import java.util.List;
20
import java.util.Properties;
21

22
import org.mybatis.generator.api.dom.java.Field;
23
import org.mybatis.generator.api.dom.java.Interface;
24
import org.mybatis.generator.api.dom.java.Method;
25
import org.mybatis.generator.api.dom.java.TopLevelClass;
26
import org.mybatis.generator.api.dom.java.TopLevelRecord;
27
import org.mybatis.generator.api.dom.kotlin.KotlinFile;
28
import org.mybatis.generator.api.dom.kotlin.KotlinFunction;
29
import org.mybatis.generator.api.dom.kotlin.KotlinProperty;
30
import org.mybatis.generator.api.dom.kotlin.KotlinType;
31
import org.mybatis.generator.api.dom.xml.Document;
32
import org.mybatis.generator.api.dom.xml.XmlElement;
33
import org.mybatis.generator.config.Context;
34

35
/**
36
 * This interface defines methods that will be called at different times during
37
 * the code generation process. These methods can be used to extend or modify
38
 * the generated code. Clients may implement this interface in its entirety, or
39
 * extend the PluginAdapter (highly recommended).
40
 *
41
 * <p>Plugins have a lifecycle. In general, the lifecycle is this:
42
 *
43
 * <ol>
44
 * <li>The setXXX methods are called one time</li>
45
 * <li>The validate method is called one time</li>
46
 * <li>The initialized method is called for each introspected table</li>
47
 * <li>The clientXXX methods are called for each introspected table</li>
48
 * <li>The providerXXX methods are called for each introspected table</li>
49
 * <li>The modelXXX methods are called for each introspected table</li>
50
 * <li>The sqlMapXXX methods are called for each introspected table</li>
51
 * <li>The contextGenerateAdditionalJavaFiles(IntrospectedTable) method is
52
 * called for each introspected table</li>
53
 * <li>The contextGenerateAdditionalXmlFiles(IntrospectedTable) method is called
54
 * for each introspected table</li>
55
 * <li>The contextGenerateAdditionalJavaFiles() method is called one time</li>
56
 * <li>The contextGenerateAdditionalXmlFiles() method is called one time</li>
57
 * </ol>
58
 *
59
 * <p>Plugins are related to contexts - so each context will have its own set of
60
 * plugins. If the same plugin is specified in multiple contexts, then each
61
 * context will hold a unique instance of the plugin.
62
 *
63
 * <p>Plugins are called, and initialized, in the same order they are specified in
64
 * the configuration.
65
 *
66
 * <p>The clientXXX, modelXXX, and sqlMapXXX methods are called by the code
67
 * generators. If you replace the default code generators with other
68
 * implementations, these methods may not be called.
69
 *
70
 * @author Jeff Butler
71
 *
72
 * @see PluginAdapter
73
 */
74
public interface Plugin {
75

76
    enum ModelClassType {
1✔
77
        PRIMARY_KEY,
1✔
78
        BASE_RECORD,
1✔
79
        RECORD_WITH_BLOBS
1✔
80
    }
81

82
    /**
83
     * Set the context under which this plugin is running.
84
     *
85
     * @param context
86
     *            the new context
87
     */
88
    void setContext(Context context);
89

90
    /**
91
     * Set properties from the plugin configuration.
92
     *
93
     * @param properties
94
     *            the new properties
95
     */
96
    void setProperties(Properties properties);
97

98
    /**
99
     * Set the comment generator for the current context.
100
     *
101
     * @param commentGenerator the comment generator
102
     */
103
    void setCommentGenerator(CommentGenerator commentGenerator);
104

105
    void setKnownRuntime(KnownRuntime knownRuntime);
106

107
    void setIndenter(Indenter indenter);
108

109
    /**
110
     * This method is called just before the getGeneratedXXXFiles methods are called on the introspected table. Plugins
111
     * can implement this method to override any of the default attributes, or change the results of database
112
     * introspection, before any code generation activities occur. Attributes are listed as static Strings with the
113
     * prefix ATTR_ in IntrospectedTable.
114
     *
115
     * <p>A good example of overriding an attribute would be the case where a user wanted to change the name of one
116
     * of the generated classes, change the target package, or change the name of the generated SQL map file.
117
     *
118
     * <p><b>Warning:</b> Anything that is listed as an attribute should not be changed by one of the other plugin
119
     * methods. For example, if you want to change the name of a generated example class, you should not simply change
120
     * the Type in the <code>modelExampleClassGenerated()</code> method. If you do, the change will not be reflected
121
     * in other generated artifacts.
122
     *
123
     * @param introspectedTable
124
     *            the introspected table
125
     */
126
    default void initialized(IntrospectedTable introspectedTable) {}
1✔
127

128
    /**
129
     * This method is called after all the setXXX methods are called, but before
130
     * any other method is called. This allows the plugin to determine whether
131
     * it can run or not. For example, if the plugin requires certain properties
132
     * to be set, and the properties are not set, then the plugin is invalid and
133
     * will not run.
134
     *
135
     * @param warnings
136
     *            add strings to this list to specify warnings. For example, if
137
     *            the plugin is invalid, you should specify why. Warnings are
138
     *            reported to users after the completion of the run.
139
     * @return true if the plugin is in a valid state. Invalid plugins will not
140
     *         be called
141
     */
142
    boolean validate(List<String> warnings);
143

144
    /**
145
     * This method can be used to generate any additional Java file needed by
146
     * your implementation. This method is called once, after all other Java
147
     * files have been generated.
148
     *
149
     * @return a List of GeneratedJavaFiles - these files will be saved
150
     *         with the other files from this run.
151
     */
152
    default List<GeneratedJavaFile> contextGenerateAdditionalJavaFiles() {
153
        return Collections.emptyList();
1✔
154
    }
155

156
    /**
157
     * This method can be used to generate additional Java files needed by your
158
     * implementation that might be related to a specific table. This method is
159
     * called once for every table in the configuration.
160
     *
161
     * @param introspectedTable
162
     *            The class containing information about the table as
163
     *            introspected from the database
164
     * @return a List of GeneratedJavaFiles - these files will be saved
165
     *         with the other files from this run.
166
     */
167
    default List<GeneratedJavaFile> contextGenerateAdditionalJavaFiles(IntrospectedTable introspectedTable) {
168
        return Collections.emptyList();
1✔
169
    }
170

171
    default List<GeneratedKotlinFile> contextGenerateAdditionalKotlinFiles() {
172
        return Collections.emptyList();
1✔
173
    }
174

175
    default List<GeneratedKotlinFile> contextGenerateAdditionalKotlinFiles(IntrospectedTable introspectedTable) {
176
        return Collections.emptyList();
1✔
177
    }
178

179
    default List<GenericGeneratedFile> contextGenerateAdditionalFiles() {
180
        return Collections.emptyList();
1✔
181
    }
182

183
    default List<GenericGeneratedFile> contextGenerateAdditionalFiles(IntrospectedTable introspectedTable) {
184
        return Collections.emptyList();
1✔
185
    }
186

187
    /**
188
     * This method can be used to generate any additional XML file needed by
189
     * your implementation. This method is called once, after all other XML
190
     * files have been generated.
191
     *
192
     * @return a List of GeneratedXmlFiles - these files will be saved
193
     *         with the other files from this run.
194
     */
195
    default List<GeneratedXmlFile> contextGenerateAdditionalXmlFiles() {
196
        return Collections.emptyList();
1✔
197
    }
198

199
    /**
200
     * This method can be used to generate additional XML files needed by your
201
     * implementation that might be related to a specific table. This method is
202
     * called once for every table in the configuration.
203
     *
204
     * @param introspectedTable
205
     *            The class containing information about the table as
206
     *            introspected from the database
207
     * @return a List of GeneratedXmlFiles - these files will be saved
208
     *         with the other files from this run.
209
     */
210
    default List<GeneratedXmlFile> contextGenerateAdditionalXmlFiles(IntrospectedTable introspectedTable) {
211
        return Collections.emptyList();
1✔
212
    }
213

214
    /**
215
     * This method is called when the entire client has been generated.
216
     * Implement this method to add additional methods or fields to a generated
217
     * client interface or implementation.
218
     *
219
     * @param interfaze
220
     *            the generated interface if any, may be null
221
     * @param introspectedTable
222
     *            The class containing information about the table as
223
     *            introspected from the database
224
     * @return true if the interface should be generated, false if the generated
225
     *         interface should be ignored. In the case of multiple plugins, the
226
     *         first plugin returning false will disable the calling of further
227
     *         plugins.
228
     */
229
    default boolean clientGenerated(Interface interfaze, IntrospectedTable introspectedTable) {
230
        return true;
1✔
231
    }
232

233
    /**
234
     * This method is called when the insert method has been generated for the mapper interface.
235
     * This method is only called in the MyBatis3DynamicSql runtime. This method is only
236
     * called if the table has generated keys.
237
     *
238
     * @param method
239
     *     the generated insert method
240
     * @param interfaze
241
     *     the partially generated mapper interfaces
242
     * @param introspectedTable
243
     *     The class containing information about the table as introspected from the database
244
     * @return true if the method should be generated, false if the generated
245
     *         method should be ignored. In the case of multiple plugins, the
246
     *         first plugin returning false will disable the calling of further
247
     *         plugins.
248
     */
249
    default boolean clientBasicInsertMethodGenerated(Method method, Interface interfaze,
250
                                                     IntrospectedTable introspectedTable) {
251
        return true;
1✔
252
    }
253

254
    /**
255
     * This method is called when the insert function has been generated for the mapper interface.
256
     * This method is only called in the MyBatis3Kotlin runtime. This method is only
257
     * called if the table has generated keys.
258
     *
259
     * @param kotlinFunction
260
     *     the generated insert function
261
     * @param kotlinFile
262
     *     the partially generated file
263
     * @param introspectedTable
264
     *     The class containing information about the table as introspected from the database
265
     * @return true if the function should be generated, false if the generated
266
     *         function should be ignored. In the case of multiple plugins, the
267
     *         first plugin returning false will disable the calling of further
268
     *         plugins.
269
     */
270
    default boolean clientBasicInsertMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
271
            IntrospectedTable introspectedTable) {
272
        return true;
1✔
273
    }
274

275
    /**
276
     * This method is called when the insert multiple method has been generated for the mapper interface.
277
     * This method is only called in the MyBatis3DynamicSql runtime. This method is only
278
     * called if the table has generated keys.
279
     *
280
     * @param method
281
     *     the generated insert method
282
     * @param interfaze
283
     *     the partially generated mapper interfaces
284
     * @param introspectedTable
285
     *     The class containing information about the table as introspected from the database
286
     * @return true if the method should be generated, false if the generated
287
     *         method should be ignored. In the case of multiple plugins, the
288
     *         first plugin returning false will disable the calling of further
289
     *         plugins.
290
     */
291
    default boolean clientBasicInsertMultipleMethodGenerated(Method method, Interface interfaze,
292
            IntrospectedTable introspectedTable) {
293
        return true;
1✔
294
    }
295

296
    /**
297
     * This method is called when the insert multiple method has been generated for the mapper interface.
298
     * This method is only called in the MyBatis3DynamicSql runtime. This method is only
299
     * called if the table has generated keys.
300
     *
301
     * @param kotlinFunction
302
     *     the generated insert function
303
     * @param kotlinFile
304
     *     the partially generated file
305
     * @param introspectedTable
306
     *     The class containing information about the table as introspected from the database
307
     * @return true if the method should be generated, false if the generated
308
     *         function should be ignored. In the case of multiple plugins, the
309
     *         first plugin returning false will disable the calling of further
310
     *         plugins.
311
     */
312
    default boolean clientBasicInsertMultipleMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
313
            IntrospectedTable introspectedTable) {
314
        return true;
1✔
315
    }
316

317
    /**
318
     * This method is called when the selectMany method has been generated for the mapper interface.
319
     * This method is only called in the MyBatis3DynamicSql runtime.
320
     *
321
     * @param method
322
     *     the generated selectMany method
323
     * @param interfaze
324
     *     the partially generated mapper interfaces
325
     * @param introspectedTable
326
     *     The class containing information about the table as introspected from the database
327
     * @return true if the method should be generated, false if the generated
328
     *         method should be ignored. In the case of multiple plugins, the
329
     *         first plugin returning false will disable the calling of further
330
     *         plugins.
331
     */
332
    default boolean clientBasicSelectManyMethodGenerated(Method method, Interface interfaze,
333
            IntrospectedTable introspectedTable) {
334
        return true;
1✔
335
    }
336

337
    default boolean clientBasicSelectManyMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
338
            IntrospectedTable introspectedTable) {
339
        return true;
1✔
340
    }
341

342
    /**
343
     * This method is called when the selectOne method has been generated for the mapper interface.
344
     * This method is only called in the MyBatis3DynamicSql runtime.
345
     *
346
     * @param method
347
     *     the generated selectOne method
348
     * @param interfaze
349
     *     the partially generated mapper interfaces
350
     * @param introspectedTable
351
     *     The class containing information about the table as introspected from the database
352
     * @return true if the method should be generated, false if the generated
353
     *         method should be ignored. In the case of multiple plugins, the
354
     *         first plugin returning false will disable the calling of further
355
     *         plugins.
356
     */
357
    default boolean clientBasicSelectOneMethodGenerated(Method method, Interface interfaze,
358
            IntrospectedTable introspectedTable) {
359
        return true;
1✔
360
    }
361

362
    default boolean clientBasicSelectOneMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
363
            IntrospectedTable introspectedTable) {
364
        return true;
1✔
365
    }
366

367
    /**
368
     * This method is called when the countByExample method has been generated
369
     * in the client interface.
370
     *
371
     * @param method
372
     *            the generated countByExample method
373
     * @param interfaze
374
     *            the partially implemented client interface. You can add
375
     *            additional imported classes to the interface if
376
     *            necessary.
377
     * @param introspectedTable
378
     *            The class containing information about the table as
379
     *            introspected from the database
380
     * @return true if the method should be generated, false if the generated
381
     *         method should be ignored. In the case of multiple plugins, the
382
     *         first plugin returning false will disable the calling of further
383
     *         plugins.
384
     */
385
    default boolean clientCountByExampleMethodGenerated(Method method,
386
            Interface interfaze, IntrospectedTable introspectedTable) {
387
        return true;
1✔
388
    }
389

390
    /**
391
     * This method is called when the deleteByExample method has been generated
392
     * in the client interface.
393
     *
394
     * @param method
395
     *            the generated deleteByExample method
396
     * @param interfaze
397
     *            the partially implemented client interface. You can add
398
     *            additional imported classes to the interface if
399
     *            necessary.
400
     * @param introspectedTable
401
     *            The class containing information about the table as
402
     *            introspected from the database
403
     * @return true if the method should be generated, false if the generated
404
     *         method should be ignored. In the case of multiple plugins, the
405
     *         first plugin returning false will disable the calling of further
406
     *         plugins.
407
     */
408
    default boolean clientDeleteByExampleMethodGenerated(Method method,
409
            Interface interfaze, IntrospectedTable introspectedTable) {
410
        return true;
1✔
411
    }
412

413
    /**
414
     * This method is called when the deleteByPrimaryKey method has been
415
     * generated in the client interface.
416
     *
417
     * @param method
418
     *            the generated deleteByPrimaryKey method
419
     * @param interfaze
420
     *            the partially implemented client interface. You can add
421
     *            additional imported classes to the interface if
422
     *            necessary.
423
     * @param introspectedTable
424
     *            The class containing information about the table as
425
     *            introspected from the database
426
     * @return true if the method should be generated, false if the generated
427
     *         method should be ignored. In the case of multiple plugins, the
428
     *         first plugin returning false will disable the calling of further
429
     *         plugins.
430
     */
431
    default boolean clientDeleteByPrimaryKeyMethodGenerated(Method method,
432
            Interface interfaze, IntrospectedTable introspectedTable) {
433
        return true;
1✔
434
    }
435

436
    default boolean clientDeleteByPrimaryKeyMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
437
            IntrospectedTable introspectedTable) {
438
        return true;
1✔
439
    }
440

441
    /**
442
     * Called when the general count method has been generated. This is the replacement for countByExample
443
     * in the MyBatis Dynamic SQL V2 runtime.
444
     *
445
     * @param method
446
     *     the generated general count method
447
     * @param interfaze
448
     *     the partially generated mapper interfaces
449
     * @param introspectedTable
450
     *            The class containing information about the table as
451
     *            introspected from the database
452
     * @return true if the method should be generated
453
     */
454
    default boolean clientGeneralCountMethodGenerated(Method method, Interface interfaze,
455
                                                      IntrospectedTable introspectedTable) {
456
        return true;
1✔
457
    }
458

459
    default boolean clientGeneralCountMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
460
            IntrospectedTable introspectedTable) {
461
        return true;
1✔
462
    }
463

464
    /**
465
     * Called when the general delete method has been generated. This is the replacement for deleteByExample
466
     * in the MyBatis Dynamic SQL V2 runtime.
467
     *
468
     * @param method
469
     *     the generated general delete method
470
     * @param interfaze
471
     *     the partially generated mapper interfaces
472
     * @param introspectedTable
473
     *            The class containing information about the table as
474
     *            introspected from the database
475
     * @return true if the method should be generated
476
     */
477
    default boolean clientGeneralDeleteMethodGenerated(Method method, Interface interfaze,
478
                                                       IntrospectedTable introspectedTable) {
479
        return true;
1✔
480
    }
481

482
    default boolean clientGeneralDeleteMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
483
            IntrospectedTable introspectedTable) {
484
        return true;
1✔
485
    }
486

487
    /**
488
     * Called when the general select distinct method has been generated. This is the replacement for
489
     * selectDistinctByExample in the MyBatis Dynamic SQL V2 runtime.
490
     *
491
     * @param method
492
     *     the generated general select distinct method
493
     * @param interfaze
494
     *     the partially generated mapper interfaces
495
     * @param introspectedTable
496
     *            The class containing information about the table as
497
     *            introspected from the database
498
     * @return true if the method should be generated
499
     */
500
    default boolean clientGeneralSelectDistinctMethodGenerated(Method method, Interface interfaze,
501
            IntrospectedTable introspectedTable) {
502
        return true;
1✔
503
    }
504

505
    default boolean clientGeneralSelectDistinctMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
506
            IntrospectedTable introspectedTable) {
507
        return true;
1✔
508
    }
509

510
    /**
511
     * Called when the general select method has been generated. This is the replacement for
512
     * selectByExample in the MyBatis Dynamic SQL V2 runtime.
513
     *
514
     * @param method
515
     *     the generated general select method
516
     * @param interfaze
517
     *     the partially generated mapper interfaces
518
     * @param introspectedTable
519
     *            The class containing information about the table as
520
     *            introspected from the database
521
     * @return true if the method should be generated
522
     */
523
    default boolean clientGeneralSelectMethodGenerated(Method method, Interface interfaze,
524
                                                       IntrospectedTable introspectedTable) {
525
        return true;
1✔
526
    }
527

528
    default boolean clientGeneralSelectMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
529
            IntrospectedTable introspectedTable) {
530
        return true;
1✔
531
    }
532

533
    /**
534
     * Called when the general update method has been generated. This is the replacement for
535
     * updateByExample in the MyBatis Dynamic SQL V2 runtime.
536
     *
537
     * @param method
538
     *     the generated general update method
539
     * @param interfaze
540
     *     the partially generated mapper interfaces
541
     * @param introspectedTable
542
     *            The class containing information about the table as
543
     *            introspected from the database
544
     * @return true if the method should be generated
545
     */
546
    default boolean clientGeneralUpdateMethodGenerated(Method method, Interface interfaze,
547
                                                       IntrospectedTable introspectedTable) {
548
        return true;
1✔
549
    }
550

551
    default boolean clientGeneralUpdateMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
552
            IntrospectedTable introspectedTable) {
553
        return true;
1✔
554
    }
555

556
    /**
557
     * This method is called when the insert method has been generated in the
558
     * client interface.
559
     *
560
     * @param method
561
     *            the generated insert method
562
     * @param interfaze
563
     *            the partially implemented client interface. You can add
564
     *            additional imported classes to the interface if
565
     *            necessary.
566
     * @param introspectedTable
567
     *            The class containing information about the table as
568
     *            introspected from the database
569
     * @return true if the method should be generated, false if the generated
570
     *         method should be ignored. In the case of multiple plugins, the
571
     *         first plugin returning false will disable the calling of further
572
     *         plugins.
573
     */
574
    default boolean clientInsertMethodGenerated(Method method, Interface interfaze,
575
            IntrospectedTable introspectedTable) {
576
        return true;
1✔
577
    }
578

579
    default boolean clientInsertMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
580
            IntrospectedTable introspectedTable) {
581
        return true;
1✔
582
    }
583

584
    /**
585
     * This method is called when the insert multiple method has been generated in the
586
     * client interface.
587
     * This method is only called in the MyBatis3DynamicSql runtime.
588
     *
589
     * @param method
590
     *            the generated insert multiple method
591
     * @param interfaze
592
     *            the partially implemented client interface. You can add
593
     *            additional imported classes to the interface if
594
     *            necessary.
595
     * @param introspectedTable
596
     *            The class containing information about the table as
597
     *            introspected from the database
598
     * @return true if the method should be generated, false if the generated
599
     *         method should be ignored. In the case of multiple plugins, the
600
     *         first plugin returning false will disable the calling of further
601
     *         plugins.
602
     */
603
    default boolean clientInsertMultipleMethodGenerated(Method method, Interface interfaze,
604
            IntrospectedTable introspectedTable) {
605
        return true;
1✔
606
    }
607

608
    default boolean clientInsertMultipleMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
609
            IntrospectedTable introspectedTable) {
610
        return true;
1✔
611
    }
612

613
    /**
614
     * This method is called when the insert selective method has been generated
615
     * in the client interface.
616
     *
617
     * @param method
618
     *            the generated insert method
619
     * @param interfaze
620
     *            the partially implemented client interface. You can add
621
     *            additional imported classes to the interface if
622
     *            necessary.
623
     * @param introspectedTable
624
     *            The class containing information about the table as
625
     *            introspected from the database
626
     * @return true if the method should be generated, false if the generated
627
     *         method should be ignored. In the case of multiple plugins, the
628
     *         first plugin returning false will disable the calling of further
629
     *         plugins.
630
     */
631
    default boolean clientInsertSelectiveMethodGenerated(Method method,
632
            Interface interfaze, IntrospectedTable introspectedTable) {
633
        return true;
1✔
634
    }
635

636
    default boolean clientInsertSelectiveMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
637
            IntrospectedTable introspectedTable) {
638
        return true;
1✔
639
    }
640

641
    /**
642
     * This method is called when the selectByExampleWithBLOBs method has been
643
     * generated in the client interface.
644
     *
645
     * @param method
646
     *            the generated selectByExampleWithBLOBs method
647
     * @param interfaze
648
     *            the partially implemented client interface. You can add
649
     *            additional imported classes to the interface if
650
     *            necessary.
651
     * @param introspectedTable
652
     *            The class containing information about the table as
653
     *            introspected from the database
654
     * @return true if the method should be generated, false if the generated
655
     *         method should be ignored. In the case of multiple plugins, the
656
     *         first plugin returning false will disable the calling of further
657
     *         plugins.
658
     */
659
    default boolean clientSelectByExampleWithBLOBsMethodGenerated(Method method,
660
            Interface interfaze, IntrospectedTable introspectedTable) {
661
        return true;
1✔
662
    }
663

664
    /**
665
     * This method is called when the selectByExampleWithoutBLOBs method has
666
     * been generated in the client interface.
667
     *
668
     * @param method
669
     *            the generated selectByExampleWithoutBLOBs method
670
     * @param interfaze
671
     *            the partially implemented client interface. You can add
672
     *            additional imported classes to the interface if
673
     *            necessary.
674
     * @param introspectedTable
675
     *            The class containing information about the table as
676
     *            introspected from the database
677
     * @return true if the method should be generated, false if the generated
678
     *         method should be ignored. In the case of multiple plugins, the
679
     *         first plugin returning false will disable the calling of further
680
     *         plugins.
681
     */
682
    default boolean clientSelectByExampleWithoutBLOBsMethodGenerated(Method method,
683
            Interface interfaze, IntrospectedTable introspectedTable) {
684
        return true;
1✔
685
    }
686

687
    /**
688
     * This method is called when the selectByPrimaryKey method has been
689
     * generated in the client interface.
690
     *
691
     * @param method
692
     *            the generated selectByPrimaryKey method
693
     * @param interfaze
694
     *            the partially implemented client interface. You can add
695
     *            additional imported classes to the interface if
696
     *            necessary.
697
     * @param introspectedTable
698
     *            The class containing information about the table as
699
     *            introspected from the database
700
     * @return true if the method should be generated, false if the generated
701
     *         method should be ignored. In the case of multiple plugins, the
702
     *         first plugin returning false will disable the calling of further
703
     *         plugins.
704
     */
705
    default boolean clientSelectByPrimaryKeyMethodGenerated(Method method,
706
            Interface interfaze, IntrospectedTable introspectedTable) {
707
        return true;
1✔
708
    }
709

710
    default boolean clientSelectByPrimaryKeyMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
711
            IntrospectedTable introspectedTable) {
712
        return true;
1✔
713
    }
714

715
    /**
716
     * Called when the selectList field is generated in a MyBatis Dynamic SQL V2 runtime.
717
     *
718
     * @param field the generated selectList field
719
     * @param interfaze
720
     *     the partially generated mapper interfaces
721
     * @param introspectedTable
722
     *            The class containing information about the table as
723
     *            introspected from the database
724
     * @return true if the field should be generated
725
     */
726
    default boolean clientSelectListFieldGenerated(Field field, Interface interfaze,
727
                                                   IntrospectedTable introspectedTable) {
728
        return true;
1✔
729
    }
730

731
    /**
732
     * Called when the selectOne method is generated. This is a new method in the MyBatis Dynamic SQL V2 runtime.
733
     *
734
     * @param method
735
     *     the generated selectOne method
736
     * @param interfaze
737
     *     the partially generated mapper interfaces
738
     * @param introspectedTable
739
     *            The class containing information about the table as
740
     *            introspected from the database
741
     * @return true if the method should be generated
742
     */
743
    default boolean clientSelectOneMethodGenerated(Method method, Interface interfaze,
744
                                                   IntrospectedTable introspectedTable) {
745
        return true;
1✔
746
    }
747

748
    default boolean clientSelectOneMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
749
            IntrospectedTable introspectedTable) {
750
        return true;
1✔
751
    }
752

753
    /**
754
     * This method is called when the updateByExampleSelective method has been
755
     * generated in the client interface.
756
     *
757
     * @param method
758
     *            the generated updateByExampleSelective method
759
     * @param interfaze
760
     *            the partially implemented client interface. You can add
761
     *            additional imported classes to the interface if
762
     *            necessary.
763
     * @param introspectedTable
764
     *            The class containing information about the table as
765
     *            introspected from the database
766
     * @return true if the method should be generated, false if the generated
767
     *         method should be ignored. In the case of multiple plugins, the
768
     *         first plugin returning false will disable the calling of further
769
     *         plugins.
770
     */
771
    default boolean clientUpdateByExampleSelectiveMethodGenerated(Method method,
772
            Interface interfaze, IntrospectedTable introspectedTable) {
773
        return true;
1✔
774
    }
775

776
    /**
777
     * Called when the updateAllColumns method is generated. The generated method can be used with the general
778
     * update method to mimic the function of the old updateByExample method.
779
     *
780
     * @param method
781
     *     the generated updateAllColumns method
782
     * @param interfaze
783
     *     the partially generated mapper interfaces
784
     * @param introspectedTable
785
     *            The class containing information about the table as
786
     *            introspected from the database
787
     * @return true if the method should be generated
788
     */
789
    default boolean clientUpdateAllColumnsMethodGenerated(Method method, Interface interfaze,
790
            IntrospectedTable introspectedTable) {
791
        return true;
1✔
792
    }
793

794
    default boolean clientUpdateAllColumnsMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
795
            IntrospectedTable introspectedTable) {
796
        return true;
1✔
797
    }
798

799
    /**
800
     * Called when the updateSelectiveColumns method is generated. The generated method can be used with the general
801
     * update method to mimic the function of the old updateByExampleSelective method.
802
     *
803
     * @param method
804
     *     the generated updateSelectiveColumns method
805
     * @param interfaze
806
     *     the partially generated mapper interfaces
807
     * @param introspectedTable
808
     *            The class containing information about the table as
809
     *            introspected from the database
810
     * @return true if the method should be generated
811
     */
812
    default boolean clientUpdateSelectiveColumnsMethodGenerated(Method method, Interface interfaze,
813
            IntrospectedTable introspectedTable) {
814
        return true;
1✔
815
    }
816

817
    default boolean clientUpdateSelectiveColumnsMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
818
            IntrospectedTable introspectedTable) {
819
        return true;
1✔
820
    }
821

822
    /**
823
     * This method is called when the updateByExampleWithBLOBs method has been
824
     * generated in the client interface.
825
     *
826
     * @param method
827
     *            the generated updateByExampleWithBLOBs method
828
     * @param interfaze
829
     *            the partially implemented client interface. You can add
830
     *            additional imported classes to the interface if
831
     *            necessary.
832
     * @param introspectedTable
833
     *            The class containing information about the table as
834
     *            introspected from the database
835
     * @return true if the method should be generated, false if the generated
836
     *         method should be ignored. In the case of multiple plugins, the
837
     *         first plugin returning false will disable the calling of further
838
     *         plugins.
839
     */
840
    default boolean clientUpdateByExampleWithBLOBsMethodGenerated(Method method,
841
            Interface interfaze, IntrospectedTable introspectedTable) {
842
        return true;
1✔
843
    }
844

845
    /**
846
     * This method is called when the updateByExampleWithoutBLOBs method has
847
     * been generated in the client interface.
848
     *
849
     * @param method
850
     *            the generated updateByExampleWithoutBLOBs method
851
     * @param interfaze
852
     *            the partially implemented client interface. You can add
853
     *            additional imported classes to the interface if
854
     *            necessary.
855
     * @param introspectedTable
856
     *            The class containing information about the table as
857
     *            introspected from the database
858
     * @return true if the method should be generated, false if the generated
859
     *         method should be ignored. In the case of multiple plugins, the
860
     *         first plugin returning false will disable the calling of further
861
     *         plugins.
862
     */
863
    default boolean clientUpdateByExampleWithoutBLOBsMethodGenerated(Method method,
864
            Interface interfaze, IntrospectedTable introspectedTable) {
865
        return true;
1✔
866
    }
867

868
    /**
869
     * This method is called when the updateByPrimaryKeySelective method has
870
     * been generated in the client interface.
871
     *
872
     * @param method
873
     *            the generated updateByPrimaryKeySelective method
874
     * @param interfaze
875
     *            the partially implemented client interface. You can add
876
     *            additional imported classes to the interface if
877
     *            necessary.
878
     * @param introspectedTable
879
     *            The class containing information about the table as
880
     *            introspected from the database
881
     * @return true if the method should be generated, false if the generated
882
     *         method should be ignored. In the case of multiple plugins, the
883
     *         first plugin returning false will disable the calling of further
884
     *         plugins.
885
     */
886
    default boolean clientUpdateByPrimaryKeySelectiveMethodGenerated(Method method,
887
            Interface interfaze, IntrospectedTable introspectedTable) {
888
        return true;
1✔
889
    }
890

891
    default boolean clientUpdateByPrimaryKeySelectiveMethodGenerated(KotlinFunction kotlinFunction,
892
            KotlinFile kotlinFile, IntrospectedTable introspectedTable) {
893
        return true;
1✔
894
    }
895

896
    /**
897
     * This method is called when the updateByPrimaryKeyWithBLOBs method has
898
     * been generated in the client interface.
899
     *
900
     * @param method
901
     *            the generated updateByPrimaryKeyWithBLOBs method
902
     * @param interfaze
903
     *            the partially implemented client interface. You can add
904
     *            additional imported classes to the interface if
905
     *            necessary.
906
     * @param introspectedTable
907
     *            The class containing information about the table as
908
     *            introspected from the database
909
     * @return true if the method should be generated, false if the generated
910
     *         method should be ignored. In the case of multiple plugins, the
911
     *         first plugin returning false will disable the calling of further
912
     *         plugins.
913
     */
914
    default boolean clientUpdateByPrimaryKeyWithBLOBsMethodGenerated(Method method,
915
            Interface interfaze, IntrospectedTable introspectedTable) {
916
        return true;
1✔
917
    }
918

919
    /**
920
     * This method is called when the updateByPrimaryKeyWithoutBLOBs method has
921
     * been generated in the client interface.
922
     *
923
     * @param method
924
     *            the generated updateByPrimaryKeyWithoutBLOBs method
925
     * @param interfaze
926
     *            the partially implemented client interface. You can add
927
     *            additional imported classes to the interface if
928
     *            necessary.
929
     * @param introspectedTable
930
     *            The class containing information about the table as
931
     *            introspected from the database
932
     * @return true if the method should be generated, false if the generated
933
     *         method should be ignored. In the case of multiple plugins, the
934
     *         first plugin returning false will disable the calling of further
935
     *         plugins.
936
     */
937
    default boolean clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated(Method method,
938
            Interface interfaze, IntrospectedTable introspectedTable) {
939
        return true;
1✔
940
    }
941

942
    /**
943
     * This method is called when the selectAll method has been
944
     * generated in the client interface.  This method is only generated by
945
     * the simple runtime.
946
     *
947
     * @param method
948
     *            the generated selectAll method
949
     * @param interfaze
950
     *            the partially implemented client interface. You can add
951
     *            additional imported classes to the interface if
952
     *            necessary.
953
     * @param introspectedTable
954
     *            The class containing information about the table as
955
     *            introspected from the database
956
     * @return true if the method should be generated, false if the generated
957
     *         method should be ignored. In the case of multiple plugins, the
958
     *         first plugin returning false will disable the calling of further
959
     *         plugins.
960
     */
961
    default boolean clientSelectAllMethodGenerated(Method method,
962
            Interface interfaze, IntrospectedTable introspectedTable) {
963
        return true;
1✔
964
    }
965

966
    /**
967
     * This method is called after the field is generated for a specific column
968
     * in a table.
969
     *
970
     * @param field
971
     *            the field generated for the specified column
972
     * @param topLevelClass
973
     *            the partially implemented model class. You can add additional
974
     *            imported classes to the implementation class if necessary.
975
     * @param introspectedColumn
976
     *            The class containing information about the column related
977
     *            to this field as introspected from the database
978
     * @param introspectedTable
979
     *            The class containing information about the table as
980
     *            introspected from the database
981
     * @param modelClassType
982
     *            the type of class that the field is generated for
983
     * @return true if the field should be generated, false if the generated
984
     *         field should be ignored. In the case of multiple plugins, the
985
     *         first plugin returning false will disable the calling of further
986
     *         plugins.
987
     */
988
    default boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass,
989
            IntrospectedColumn introspectedColumn,
990
            IntrospectedTable introspectedTable, ModelClassType modelClassType) {
991
        return true;
1✔
992
    }
993

994
    /**
995
     * This method is called after the getter, or accessor, method is generated
996
     * for a specific column in a table.
997
     *
998
     * @param method
999
     *            the getter, or accessor, method generated for the specified
1000
     *            column
1001
     * @param topLevelClass
1002
     *            the partially implemented model class. You can add additional
1003
     *            imported classes to the implementation class if necessary.
1004
     * @param introspectedColumn
1005
     *            The class containing information about the column related
1006
     *            to this field as introspected from the database
1007
     * @param introspectedTable
1008
     *            The class containing information about the table as
1009
     *            introspected from the database
1010
     * @param modelClassType
1011
     *            the type of class that the field is generated for
1012
     * @return true if the method should be generated, false if the generated
1013
     *         method should be ignored. In the case of multiple plugins, the
1014
     *         first plugin returning false will disable the calling of further
1015
     *         plugins.
1016
     */
1017
    default boolean modelGetterMethodGenerated(Method method,
1018
            TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn,
1019
            IntrospectedTable introspectedTable, ModelClassType modelClassType) {
1020
        return true;
1✔
1021
    }
1022

1023
    /**
1024
     * This method is called after the setter, or mutator, method is generated
1025
     * for a specific column in a table.
1026
     *
1027
     * @param method
1028
     *            the setter, or mutator, method generated for the specified
1029
     *            column
1030
     * @param topLevelClass
1031
     *            the partially implemented model class. You can add additional
1032
     *            imported classes to the implementation class if necessary.
1033
     * @param introspectedColumn
1034
     *            The class containing information about the column related
1035
     *            to this field as introspected from the database
1036
     * @param introspectedTable
1037
     *            The class containing information about the table as
1038
     *            introspected from the database
1039
     * @param modelClassType
1040
     *            the type of class that the field is generated for
1041
     * @return true if the method should be generated, false if the generated
1042
     *         method should be ignored. In the case of multiple plugins, the
1043
     *         first plugin returning false will disable the calling of further
1044
     *         plugins.
1045
     */
1046
    default boolean modelSetterMethodGenerated(Method method,
1047
            TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn,
1048
            IntrospectedTable introspectedTable, ModelClassType modelClassType) {
1049
        return true;
1✔
1050
    }
1051

1052
    /**
1053
     * This method is called after the primary key class is generated by the
1054
     * ModelGenerator. This method will only be called if
1055
     * the table rules call for generation of a primary key class.
1056
     * <br><br>
1057
     * This method is only guaranteed to be called by the Java
1058
     * model generators. Other user supplied generators may, or may not, call
1059
     * this method.
1060
     *
1061
     * @param topLevelClass
1062
     *            the generated primary key class
1063
     * @param introspectedTable
1064
     *            The class containing information about the table as
1065
     *            introspected from the database
1066
     * @return true if the class should be generated, false if the generated
1067
     *         class should be ignored. In the case of multiple plugins, the
1068
     *         first plugin returning false will disable the calling of further
1069
     *         plugins.
1070
     */
1071
    default boolean modelPrimaryKeyClassGenerated(TopLevelClass topLevelClass,
1072
            IntrospectedTable introspectedTable) {
1073
        return true;
1✔
1074
    }
1075

1076
    /**
1077
     * This method is called after the base record class is generated by the
1078
     * ModelGenerator. This method will only be called if
1079
     * the table rules call for generation of a base record class.
1080
     * <br><br>
1081
     * This method is only guaranteed to be called by the default Java
1082
     * model generators. Other user supplied generators may, or may not, call
1083
     * this method.
1084
     *
1085
     * @param topLevelClass
1086
     *            the generated base record class
1087
     * @param introspectedTable
1088
     *            The class containing information about the table as
1089
     *            introspected from the database
1090
     * @return true if the class should be generated, false if the generated
1091
     *         class should be ignored. In the case of multiple plugins, the
1092
     *         first plugin returning false will disable the calling of further
1093
     *         plugins.
1094
     */
1095
    default boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass,
1096
            IntrospectedTable introspectedTable) {
1097
        return true;
1✔
1098
    }
1099

1100
    /**
1101
     * This method is called after the record with BLOBs class is generated by
1102
     * the ModelGenerator. This method will only be called
1103
     * if the table rules call for generation of a record with BLOBs class.
1104
     * <br><br>
1105
     * This method is only guaranteed to be called by the default Java
1106
     * model generators. Other user supplied generators may, or may not, call
1107
     * this method.
1108
     *
1109
     * @param topLevelClass
1110
     *            the generated record with BLOBs class
1111
     * @param introspectedTable
1112
     *            The class containing information about the table as
1113
     *            introspected from the database
1114
     * @return true if the class should be generated, false if the generated
1115
     *         class should be ignored. In the case of multiple plugins, the
1116
     *         first plugin returning false will disable the calling of further
1117
     *         plugins.
1118
     */
1119
    default boolean modelRecordWithBLOBsClassGenerated(TopLevelClass topLevelClass,
1120
            IntrospectedTable introspectedTable) {
1121
        return true;
×
1122
    }
1123

1124
    /**
1125
     * This method is called after the example class is generated by the
1126
     * ModelGenerator. This method will only be called if the table
1127
     * rules call for generation of an example class.
1128
     * <br><br>
1129
     * This method is only guaranteed to be called by the default Java
1130
     * model generators. Other user supplied generators may, or may not, call
1131
     * this method.
1132
     *
1133
     * @param topLevelClass
1134
     *            the generated example class
1135
     * @param introspectedTable
1136
     *            The class containing information about the table as
1137
     *            introspected from the database
1138
     * @return true if the class should be generated, false if the generated
1139
     *         class should be ignored. In the case of multiple plugins, the
1140
     *         first plugin returning false will disable the calling of further
1141
     *         plugins.
1142
     */
1143
    default boolean modelExampleClassGenerated(TopLevelClass topLevelClass,
1144
            IntrospectedTable introspectedTable) {
1145
        return true;
1✔
1146
    }
1147

1148
    /**
1149
     * This method is called after a record class is generated (when the model type is "record")
1150
     * The record is generated by the
1151
     * ModelGenerator.
1152
     * <br><br>
1153
     * This method is only guaranteed to be called by the default Java
1154
     * model generators. Other user supplied generators may, or may not, call
1155
     * this method.
1156
     *
1157
     * @param topLevelRecord
1158
     *            the generated record
1159
     * @param introspectedTable
1160
     *            The class containing information about the table as
1161
     *            introspected from the database
1162
     * @return true if the record should be generated, false if the generated
1163
     *         record should be ignored. In the case of multiple plugins, the
1164
     *         first plugin returning false will disable the calling of further
1165
     *         plugins.
1166
     */
1167
    default boolean modelRecordGenerated(TopLevelRecord topLevelRecord, IntrospectedTable introspectedTable) {
1168
        return true;
1✔
1169
    }
1170

1171
    /**
1172
     * This method is called when the SqlMap file has been generated.
1173
     *
1174
     * @param sqlMap
1175
     *            the generated file (containing the file name, package name,
1176
     *            and project name)
1177
     * @param introspectedTable
1178
     *            The class containing information about the table as
1179
     *            introspected from the database
1180
     * @return true if the sqlMap should be generated, false if the generated
1181
     *         sqlMap should be ignored. In the case of multiple plugins, the
1182
     *         first plugin returning false will disable the calling of further
1183
     *         plugins.
1184
     */
1185
    default boolean sqlMapGenerated(GeneratedXmlFile sqlMap,
1186
            IntrospectedTable introspectedTable) {
1187
        return true;
1✔
1188
    }
1189

1190
    /**
1191
     * This method is called when the SqlMap document has been generated. This
1192
     * method can be used to add additional XML elements to the generated
1193
     * document.
1194
     *
1195
     * @param document
1196
     *            the generated document (note that this is the MyBatis generator's internal
1197
     *            Document class - not the w3c XML Document class)
1198
     * @param introspectedTable
1199
     *            The class containing information about the table as
1200
     *            introspected from the database
1201
     * @return true if the document should be generated, false if the generated
1202
     *         document should be ignored. In the case of multiple plugins, the
1203
     *         first plugin returning false will disable the calling of further
1204
     *         plugins. Also, if any plugin returns false, then the
1205
     *         <code>sqlMapGenerated</code> method will not be called.
1206
     */
1207
    default boolean sqlMapDocumentGenerated(Document document, IntrospectedTable introspectedTable) {
1208
        return true;
1✔
1209
    }
1210

1211
    /**
1212
     * This method is called when the base resultMap is generated.
1213
     *
1214
     * @param element
1215
     *            the generated &lt;resultMap&gt; element
1216
     * @param introspectedTable
1217
     *            The class containing information about the table as
1218
     *            introspected from the database
1219
     * @return true if the element should be generated, false if the generated
1220
     *         element should be ignored. In the case of multiple plugins, the
1221
     *         first plugin returning false will disable the calling of further
1222
     *         plugins.
1223
     */
1224
    default boolean sqlMapResultMapWithoutBLOBsElementGenerated(XmlElement element,
1225
            IntrospectedTable introspectedTable) {
1226
        return true;
1✔
1227
    }
1228

1229
    /**
1230
     * This method is called when the countByExample element is generated.
1231
     *
1232
     * @param element
1233
     *            the generated &lt;select&gt; element
1234
     * @param introspectedTable
1235
     *            The class containing information about the table as
1236
     *            introspected from the database
1237
     * @return true if the element should be generated, false if the generated
1238
     *         element should be ignored. In the case of multiple plugins, the
1239
     *         first plugin returning false will disable the calling of further
1240
     *         plugins.
1241
     */
1242
    default boolean sqlMapCountByExampleElementGenerated(XmlElement element,
1243
            IntrospectedTable introspectedTable) {
1244
        return true;
1✔
1245
    }
1246

1247
    /**
1248
     * This method is called when the deleteByExample element is generated.
1249
     *
1250
     * @param element
1251
     *            the generated &lt;delete&gt; element
1252
     * @param introspectedTable
1253
     *            The class containing information about the table as
1254
     *            introspected from the database
1255
     * @return true if the element should be generated, false if the generated
1256
     *         element should be ignored. In the case of multiple plugins, the
1257
     *         first plugin returning false will disable the calling of further
1258
     *         plugins.
1259
     */
1260
    default boolean sqlMapDeleteByExampleElementGenerated(XmlElement element,
1261
            IntrospectedTable introspectedTable) {
1262
        return true;
1✔
1263
    }
1264

1265
    /**
1266
     * This method is called when the deleteByPrimaryKey element is generated.
1267
     *
1268
     * @param element
1269
     *            the generated &lt;delete&gt; element
1270
     * @param introspectedTable
1271
     *            The class containing information about the table as
1272
     *            introspected from the database
1273
     * @return true if the element should be generated, false if the generated
1274
     *         element should be ignored. In the case of multiple plugins, the
1275
     *         first plugin returning false will disable the calling of further
1276
     *         plugins.
1277
     */
1278
    default boolean sqlMapDeleteByPrimaryKeyElementGenerated(XmlElement element,
1279
            IntrospectedTable introspectedTable) {
1280
        return true;
1✔
1281
    }
1282

1283
    /**
1284
     * This method is called when the exampleWhereClause element is generated.
1285
     *
1286
     * @param element
1287
     *            the generated &lt;sql&gt; element
1288
     * @param introspectedTable
1289
     *            The class containing information about the table as
1290
     *            introspected from the database
1291
     * @return true if the element should be generated, false if the generated
1292
     *         element should be ignored. In the case of multiple plugins, the
1293
     *         first plugin returning false will disable the calling of further
1294
     *         plugins.
1295
     */
1296
    default boolean sqlMapExampleWhereClauseElementGenerated(XmlElement element,
1297
            IntrospectedTable introspectedTable) {
1298
        return true;
1✔
1299
    }
1300

1301
    /**
1302
     * This method is called when the baseColumnList element is generated.
1303
     *
1304
     * @param element
1305
     *            the generated &lt;sql&gt; element
1306
     * @param introspectedTable
1307
     *            The class containing information about the table as
1308
     *            introspected from the database
1309
     * @return true if the element should be generated, false if the generated
1310
     *         element should be ignored. In the case of multiple plugins, the
1311
     *         first plugin returning false will disable the calling of further
1312
     *         plugins.
1313
     */
1314
    default boolean sqlMapBaseColumnListElementGenerated(XmlElement element,
1315
            IntrospectedTable introspectedTable) {
1316
        return true;
1✔
1317
    }
1318

1319
    /**
1320
     * This method is called when the blobColumnList element is generated.
1321
     *
1322
     * @param element
1323
     *            the generated &lt;sql&gt; element
1324
     * @param introspectedTable
1325
     *            The class containing information about the table as
1326
     *            introspected from the database
1327
     * @return true if the element should be generated, false if the generated
1328
     *         element should be ignored. In the case of multiple plugins, the
1329
     *         first plugin returning false will disable the calling of further
1330
     *         plugins.
1331
     */
1332
    default boolean sqlMapBlobColumnListElementGenerated(XmlElement element,
1333
            IntrospectedTable introspectedTable) {
1334
        return true;
1✔
1335
    }
1336

1337
    /**
1338
     * This method is called when the insert element is generated.
1339
     *
1340
     * @param element
1341
     *            the generated &lt;insert&gt; element
1342
     * @param introspectedTable
1343
     *            The class containing information about the table as
1344
     *            introspected from the database
1345
     * @return true if the element should be generated, false if the generated
1346
     *         element should be ignored. In the case of multiple plugins, the
1347
     *         first plugin returning false will disable the calling of further
1348
     *         plugins.
1349
     */
1350
    default boolean sqlMapInsertElementGenerated(XmlElement element,
1351
            IntrospectedTable introspectedTable) {
1352
        return true;
1✔
1353
    }
1354

1355
    /**
1356
     * This method is called when the insert selective element is generated.
1357
     *
1358
     * @param element
1359
     *            the generated &lt;insert&gt; element
1360
     * @param introspectedTable
1361
     *            The class containing information about the table as
1362
     *            introspected from the database
1363
     * @return true if the element should be generated, false if the generated
1364
     *         element should be ignored. In the case of multiple plugins, the
1365
     *         first plugin returning false will disable the calling of further
1366
     *         plugins.
1367
     */
1368
    default boolean sqlMapInsertSelectiveElementGenerated(XmlElement element,
1369
            IntrospectedTable introspectedTable) {
1370
        return true;
1✔
1371
    }
1372

1373
    /**
1374
     * This method is called when the resultMap with BLOBs element is generated
1375
     * - this resultMap will extend the base resultMap.
1376
     *
1377
     * @param element
1378
     *            the generated &lt;resultMap&gt; element
1379
     * @param introspectedTable
1380
     *            The class containing information about the table as
1381
     *            introspected from the database
1382
     * @return true if the element should be generated, false if the generated
1383
     *         element should be ignored. In the case of multiple plugins, the
1384
     *         first plugin returning false will disable the calling of further
1385
     *         plugins.
1386
     */
1387
    default boolean sqlMapResultMapWithBLOBsElementGenerated(XmlElement element,
1388
            IntrospectedTable introspectedTable) {
1389
        return true;
1✔
1390
    }
1391

1392
    /**
1393
     * This method is called when the selectAll element is generated.
1394
     *
1395
     * @param element
1396
     *            the generated &lt;select&gt; element
1397
     * @param introspectedTable
1398
     *            The class containing information about the table as
1399
     *            introspected from the database
1400
     * @return true if the element should be generated, false if the generated
1401
     *         element should be ignored. In the case of multiple plugins, the
1402
     *         first plugin returning false will disable the calling of further
1403
     *         plugins.
1404
     */
1405
    default boolean sqlMapSelectAllElementGenerated(XmlElement element,
1406
            IntrospectedTable introspectedTable) {
1407
        return true;
1✔
1408
    }
1409

1410
    /**
1411
     * This method is called when the selectByPrimaryKey element is generated.
1412
     *
1413
     * @param element
1414
     *            the generated &lt;select&gt; element
1415
     * @param introspectedTable
1416
     *            The class containing information about the table as
1417
     *            introspected from the database
1418
     * @return true if the element should be generated, false if the generated
1419
     *         element should be ignored. In the case of multiple plugins, the
1420
     *         first plugin returning false will disable the calling of further
1421
     *         plugins.
1422
     */
1423
    default boolean sqlMapSelectByPrimaryKeyElementGenerated(XmlElement element,
1424
            IntrospectedTable introspectedTable) {
1425
        return true;
1✔
1426
    }
1427

1428
    /**
1429
     * This method is called when the selectByExample element is generated.
1430
     *
1431
     * @param element
1432
     *            the generated &lt;select&gt; element
1433
     * @param introspectedTable
1434
     *            The class containing information about the table as
1435
     *            introspected from the database
1436
     * @return true if the element should be generated, false if the generated
1437
     *         element should be ignored. In the case of multiple plugins, the
1438
     *         first plugin returning false will disable the calling of further
1439
     *         plugins.
1440
     */
1441
    default boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(
1442
            XmlElement element, IntrospectedTable introspectedTable) {
1443
        return true;
1✔
1444
    }
1445

1446
    /**
1447
     * This method is called when the selectByExampleWithBLOBs element is
1448
     * generated.
1449
     *
1450
     * @param element
1451
     *            the generated &lt;select&gt; element
1452
     * @param introspectedTable
1453
     *            The class containing information about the table as
1454
     *            introspected from the database
1455
     * @return true if the element should be generated, false if the generated
1456
     *         element should be ignored. In the case of multiple plugins, the
1457
     *         first plugin returning false will disable the calling of further
1458
     *         plugins.
1459
     */
1460
    default boolean sqlMapSelectByExampleWithBLOBsElementGenerated(XmlElement element,
1461
            IntrospectedTable introspectedTable) {
1462
        return true;
1✔
1463
    }
1464

1465
    /**
1466
     * This method is called when the updateByExampleSelective element is
1467
     * generated.
1468
     *
1469
     * @param element
1470
     *            the generated &lt;update&gt; element
1471
     * @param introspectedTable
1472
     *            The class containing information about the table as
1473
     *            introspected from the database
1474
     * @return true if the element should be generated, false if the generated
1475
     *         element should be ignored. In the case of multiple plugins, the
1476
     *         first plugin returning false will disable the calling of further
1477
     *         plugins.
1478
     */
1479
    default boolean sqlMapUpdateByExampleSelectiveElementGenerated(XmlElement element,
1480
            IntrospectedTable introspectedTable) {
1481
        return true;
1✔
1482
    }
1483

1484
    /**
1485
     * This method is called when the updateByExampleWithBLOBs element is
1486
     * generated.
1487
     *
1488
     * @param element
1489
     *            the generated &lt;update&gt; element
1490
     * @param introspectedTable
1491
     *            The class containing information about the table as
1492
     *            introspected from the database
1493
     * @return true if the element should be generated, false if the generated
1494
     *         element should be ignored. In the case of multiple plugins, the
1495
     *         first plugin returning false will disable the calling of further
1496
     *         plugins.
1497
     */
1498
    default boolean sqlMapUpdateByExampleWithBLOBsElementGenerated(XmlElement element,
1499
            IntrospectedTable introspectedTable) {
1500
        return true;
1✔
1501
    }
1502

1503
    /**
1504
     * This method is called when the updateByExampleWithourBLOBs element is
1505
     * generated.
1506
     *
1507
     * @param element
1508
     *            the generated &lt;update&gt; element
1509
     * @param introspectedTable
1510
     *            The class containing information about the table as
1511
     *            introspected from the database
1512
     * @return true if the element should be generated, false if the generated
1513
     *         element should be ignored. In the case of multiple plugins, the
1514
     *         first plugin returning false will disable the calling of further
1515
     *         plugins.
1516
     */
1517
    default boolean sqlMapUpdateByExampleWithoutBLOBsElementGenerated(
1518
            XmlElement element, IntrospectedTable introspectedTable) {
1519
        return true;
1✔
1520
    }
1521

1522
    /**
1523
     * This method is called when the updateByPrimaryKeySelective element is
1524
     * generated.
1525
     *
1526
     * @param element
1527
     *            the generated &lt;update&gt; element
1528
     * @param introspectedTable
1529
     *            The class containing information about the table as
1530
     *            introspected from the database
1531
     * @return true if the element should be generated, false if the generated
1532
     *         element should be ignored. In the case of multiple plugins, the
1533
     *         first plugin returning false will disable the calling of further
1534
     *         plugins.
1535
     */
1536
    default boolean sqlMapUpdateByPrimaryKeySelectiveElementGenerated(
1537
            XmlElement element, IntrospectedTable introspectedTable) {
1538
        return true;
1✔
1539
    }
1540

1541
    /**
1542
     * This method is called when the updateByPrimaryKeyWithBLOBs element is
1543
     * generated.
1544
     *
1545
     * @param element
1546
     *            the generated &lt;update&gt; element
1547
     * @param introspectedTable
1548
     *            The class containing information about the table as
1549
     *            introspected from the database
1550
     * @return true if the element should be generated, false if the generated
1551
     *         element should be ignored. In the case of multiple plugins, the
1552
     *         first plugin returning false will disable the calling of further
1553
     *         plugins.
1554
     */
1555
    default boolean sqlMapUpdateByPrimaryKeyWithBLOBsElementGenerated(
1556
            XmlElement element, IntrospectedTable introspectedTable) {
1557
        return true;
1✔
1558
    }
1559

1560
    /**
1561
     * This method is called when the updateByPrimaryKeyWithoutBLOBs element is
1562
     * generated.
1563
     *
1564
     * @param element
1565
     *            the generated &lt;update&gt; element
1566
     * @param introspectedTable
1567
     *            The class containing information about the table as
1568
     *            introspected from the database
1569
     * @return true if the element should be generated, false if the generated
1570
     *         element should be ignored. In the case of multiple plugins, the
1571
     *         first plugin returning false will disable the calling of further
1572
     *         plugins.
1573
     */
1574
    default boolean sqlMapUpdateByPrimaryKeyWithoutBLOBsElementGenerated(
1575
            XmlElement element, IntrospectedTable introspectedTable) {
1576
        return true;
1✔
1577
    }
1578

1579
    /**
1580
     * This method is called when the SQL provider has been generated.
1581
     * Implement this method to add additional methods or fields to a generated
1582
     * SQL provider.
1583
     *
1584
     * @param topLevelClass
1585
     *            the generated provider
1586
     * @param introspectedTable
1587
     *            The class containing information about the table as
1588
     *            introspected from the database
1589
     * @return true if the provider should be generated, false if the generated
1590
     *         provider should be ignored. In the case of multiple plugins, the
1591
     *         first plugin returning false will disable the calling of further
1592
     *         plugins.
1593
     */
1594
    default boolean providerGenerated(TopLevelClass topLevelClass,
1595
            IntrospectedTable introspectedTable) {
1596
        return true;
1✔
1597
    }
1598

1599
    /**
1600
     * This method is called when the applyWhere method has
1601
     * been generated in the SQL provider.
1602
     *
1603
     * @param method
1604
     *            the generated applyWhere method
1605
     * @param topLevelClass
1606
     *            the partially generated provider class
1607
     *            You can add additional imported classes to the class
1608
     *            if necessary.
1609
     * @param introspectedTable
1610
     *            The class containing information about the table as
1611
     *            introspected from the database
1612
     * @return true if the method should be generated, false if the generated
1613
     *         method should be ignored. In the case of multiple plugins, the
1614
     *         first plugin returning false will disable the calling of further
1615
     *         plugins.
1616
     */
1617
    default boolean providerApplyWhereMethodGenerated(Method method,
1618
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1619
        return true;
1✔
1620
    }
1621

1622
    /**
1623
     * This method is called when the countByExample method has
1624
     * been generated in the SQL provider.
1625
     *
1626
     * @param method
1627
     *            the generated countByExample method
1628
     * @param topLevelClass
1629
     *            the partially generated provider class
1630
     *            You can add additional imported classes to the class
1631
     *            if necessary.
1632
     * @param introspectedTable
1633
     *            The class containing information about the table as
1634
     *            introspected from the database
1635
     * @return true if the method should be generated, false if the generated
1636
     *         method should be ignored. In the case of multiple plugins, the
1637
     *         first plugin returning false will disable the calling of further
1638
     *         plugins.
1639
     */
1640
    default boolean providerCountByExampleMethodGenerated(Method method,
1641
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1642
        return true;
1✔
1643
    }
1644

1645
    /**
1646
     * This method is called when the deleteByExample method has
1647
     * been generated in the SQL provider.
1648
     *
1649
     * @param method
1650
     *            the generated deleteByExample method
1651
     * @param topLevelClass
1652
     *            the partially generated provider class
1653
     *            You can add additional imported classes to the class
1654
     *            if necessary.
1655
     * @param introspectedTable
1656
     *            The class containing information about the table as
1657
     *            introspected from the database
1658
     * @return true if the method should be generated, false if the generated
1659
     *         method should be ignored. In the case of multiple plugins, the
1660
     *         first plugin returning false will disable the calling of further
1661
     *         plugins.
1662
     */
1663
    default boolean providerDeleteByExampleMethodGenerated(Method method,
1664
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1665
        return true;
1✔
1666
    }
1667

1668
    /**
1669
     * This method is called when the insertSelective method has
1670
     * been generated in the SQL provider.
1671
     *
1672
     * @param method
1673
     *            the generated insertSelective method
1674
     * @param topLevelClass
1675
     *            the partially generated provider class
1676
     *            You can add additional imported classes to the class
1677
     *            if necessary.
1678
     * @param introspectedTable
1679
     *            The class containing information about the table as
1680
     *            introspected from the database
1681
     * @return true if the method should be generated, false if the generated
1682
     *         method should be ignored. In the case of multiple plugins, the
1683
     *         first plugin returning false will disable the calling of further
1684
     *         plugins.
1685
     */
1686
    default boolean providerInsertSelectiveMethodGenerated(Method method,
1687
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1688
        return true;
1✔
1689
    }
1690

1691
    /**
1692
     * This method is called when the selectByExampleWithBLOBs method has
1693
     * been generated in the SQL provider.
1694
     *
1695
     * @param method
1696
     *            the generated selectByExampleWithBLOBs method
1697
     * @param topLevelClass
1698
     *            the partially generated provider class
1699
     *            You can add additional imported classes to the class
1700
     *            if necessary.
1701
     * @param introspectedTable
1702
     *            The class containing information about the table as
1703
     *            introspected from the database
1704
     * @return true if the method should be generated, false if the generated
1705
     *         method should be ignored. In the case of multiple plugins, the
1706
     *         first plugin returning false will disable the calling of further
1707
     *         plugins.
1708
     */
1709
    default boolean providerSelectByExampleWithBLOBsMethodGenerated(Method method,
1710
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1711
        return true;
1✔
1712
    }
1713

1714
    /**
1715
     * This method is called when the selectByExampleWithoutBLOBs method has
1716
     * been generated in the SQL provider.
1717
     *
1718
     * @param method
1719
     *            the generated selectByExampleWithoutBLOBs method
1720
     * @param topLevelClass
1721
     *            the partially generated provider class
1722
     *            You can add additional imported classes to the class
1723
     *            if necessary.
1724
     * @param introspectedTable
1725
     *            The class containing information about the table as
1726
     *            introspected from the database
1727
     * @return true if the method should be generated, false if the generated
1728
     *         method should be ignored. In the case of multiple plugins, the
1729
     *         first plugin returning false will disable the calling of further
1730
     *         plugins.
1731
     */
1732
    default boolean providerSelectByExampleWithoutBLOBsMethodGenerated(Method method,
1733
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1734
        return true;
1✔
1735
    }
1736

1737
    /**
1738
     * This method is called when the updateByExampleSelective method has
1739
     * been generated in the SQL provider.
1740
     *
1741
     * @param method
1742
     *            the generated updateByExampleSelective method
1743
     * @param topLevelClass
1744
     *            the partially generated provider class
1745
     *            You can add additional imported classes to the class
1746
     *            if necessary.
1747
     * @param introspectedTable
1748
     *            The class containing information about the table as
1749
     *            introspected from the database
1750
     * @return true if the method should be generated, false if the generated
1751
     *         method should be ignored. In the case of multiple plugins, the
1752
     *         first plugin returning false will disable the calling of further
1753
     *         plugins.
1754
     */
1755
    default boolean providerUpdateByExampleSelectiveMethodGenerated(Method method,
1756
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1757
        return true;
1✔
1758
    }
1759

1760
    /**
1761
     * This method is called when the updateByExampleWithBLOBs method has
1762
     * been generated in the SQL provider.
1763
     *
1764
     * @param method
1765
     *            the generated updateByExampleWithBLOBs method
1766
     * @param topLevelClass
1767
     *            the partially generated provider class
1768
     *            You can add additional imported classes to the class
1769
     *            if necessary.
1770
     * @param introspectedTable
1771
     *            The class containing information about the table as
1772
     *            introspected from the database
1773
     * @return true if the method should be generated, false if the generated
1774
     *         method should be ignored. In the case of multiple plugins, the
1775
     *         first plugin returning false will disable the calling of further
1776
     *         plugins.
1777
     */
1778
    default boolean providerUpdateByExampleWithBLOBsMethodGenerated(Method method,
1779
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1780
        return true;
1✔
1781
    }
1782

1783
    /**
1784
     * This method is called when the updateByExampleWithoutBLOBs method has
1785
     * been generated in the SQL provider.
1786
     *
1787
     * @param method
1788
     *            the generated updateByExampleWithoutBLOBs method
1789
     * @param topLevelClass
1790
     *            the partially generated provider class
1791
     *            You can add additional imported classes to the class
1792
     *            if necessary.
1793
     * @param introspectedTable
1794
     *            The class containing information about the table as
1795
     *            introspected from the database
1796
     * @return true if the method should be generated, false if the generated
1797
     *         method should be ignored. In the case of multiple plugins, the
1798
     *         first plugin returning false will disable the calling of further
1799
     *         plugins.
1800
     */
1801
    default boolean providerUpdateByExampleWithoutBLOBsMethodGenerated(Method method,
1802
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1803
        return true;
1✔
1804
    }
1805

1806
    /**
1807
     * This method is called when the updateByPrimaryKeySelective method has
1808
     * been generated in the SQL provider.
1809
     *
1810
     * @param method
1811
     *            the generated updateByPrimaryKeySelective method
1812
     * @param topLevelClass
1813
     *            the partially generated provider class
1814
     *            You can add additional imported classes to the class
1815
     *            if necessary.
1816
     * @param introspectedTable
1817
     *            The class containing information about the table as
1818
     *            introspected from the database
1819
     * @return true if the method should be generated, false if the generated
1820
     *         method should be ignored. In the case of multiple plugins, the
1821
     *         first plugin returning false will disable the calling of further
1822
     *         plugins.
1823
     */
1824
    default boolean providerUpdateByPrimaryKeySelectiveMethodGenerated(Method method,
1825
            TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
1826
        return true;
1✔
1827
    }
1828

1829
    /**
1830
     * This method is called when the MyBatis Dynamic SQL support class has
1831
     * been generated in the MyBatis Dynamic SQL runtime.
1832
     *
1833
     * @param supportClass
1834
     *            the generated MyBatis Dynamic SQL support class
1835
     *            You can add additional items to the generated class
1836
     *            if necessary.
1837
     * @param introspectedTable
1838
     *            The class containing information about the table as
1839
     *            introspected from the database
1840
     * @return true if the class should be generated, false if the generated
1841
     *         class should be ignored. In the case of multiple plugins, the
1842
     *         first plugin returning false will disable the calling of further
1843
     *         plugins.
1844
     */
1845
    default boolean dynamicSqlSupportGenerated(TopLevelClass supportClass, IntrospectedTable introspectedTable) {
1846
        return true;
1✔
1847
    }
1848

1849
    /**
1850
     * This method is called when the MyBatis Dynamic SQL support object has been generated. The format of the class
1851
     * is an outer object with an inner class. The inner class contains the table and column definitions. The outer
1852
     * (singleton) object contains a reference to an instance of the inner class, and shortcut properties that
1853
     * reference the columns of that instance.
1854
     *
1855
     * @param kotlinFile the generated Kotlin file containing the outer object and inner class
1856
     * @param outerSupportObject a reference to the outer object in the file
1857
     * @param innerSupportClass a reference to the inner class
1858
     * @param introspectedTable the class containing information about the table as
1859
     *                          introspected from the database
1860
     * @return true if the generated file should be kept
1861
     */
1862
    default boolean dynamicSqlSupportGenerated(KotlinFile kotlinFile, KotlinType outerSupportObject,
1863
                                               KotlinType innerSupportClass, IntrospectedTable introspectedTable) {
1864
        return true;
1✔
1865
    }
1866

1867
    default boolean mapperGenerated(KotlinFile mapperFile, KotlinType mapper, IntrospectedTable introspectedTable) {
1868
        return true;
1✔
1869
    }
1870

1871
    default boolean kotlinDataClassGenerated(KotlinFile kotlinFile, KotlinType dataClass,
1872
            IntrospectedTable introspectedTable) {
1873
        return true;
1✔
1874
    }
1875

1876
    default boolean clientColumnListPropertyGenerated(KotlinProperty kotlinProperty, KotlinFile kotlinFile,
1877
            IntrospectedTable introspectedTable) {
1878
        return true;
1✔
1879
    }
1880

1881
    default boolean clientInsertMultipleVarargMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
1882
            IntrospectedTable introspectedTable) {
1883
        return true;
1✔
1884
    }
1885

1886
    default boolean clientUpdateByPrimaryKeyMethodGenerated(KotlinFunction kotlinFunction, KotlinFile kotlinFile,
1887
            IntrospectedTable introspectedTable) {
1888
        return true;
1✔
1889
    }
1890

1891
    /**
1892
     * The motivation for adding this method can be found in
1893
     * <a href="https://github.com/mybatis/generator/issues/1116">https://github.com/mybatis/generator/issues/1116</a>
1894
     *
1895
     * <p>This method is called when the updateByPrimaryKey method
1896
     * has been generated in the dynamic SQL runtime client interface.
1897
     *
1898
     * @param method
1899
     *            the generated updateByPrimaryKey method
1900
     * @param interfaze
1901
     *            the partially implemented client interface. You can add
1902
     *            additional imported classes to the interface if
1903
     *            necessary.
1904
     * @param introspectedTable
1905
     *            The class containing information about the table as
1906
     *            introspected from the database
1907
     * @return true if the method should be generated, false if the generated
1908
     *         method should be ignored. In the case of multiple plugins, the
1909
     *         first plugin returning false will disable the calling of further
1910
     *         plugins.
1911
     */
1912
    default boolean clientUpdateByPrimaryKeyMethodGenerated(Method method,
1913
            Interface interfaze, IntrospectedTable introspectedTable) {
1914
        return clientUpdateByPrimaryKeyWithBLOBsMethodGenerated(method, interfaze, introspectedTable);
1✔
1915
    }
1916

1917
    /**
1918
     * If false, the table will be skipped in code generation.
1919
     *
1920
     * @param introspectedTable the current table
1921
     * @return true if code should be generated for this table, else false
1922
     */
1923
    default boolean shouldGenerate(IntrospectedTable introspectedTable) {
1924
        return true;
1✔
1925
    }
1926
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc