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

mybatis / generator / 1957

18 Jan 2026 03:34PM UTC coverage: 88.883% (-0.07%) from 88.948%
1957

Pull #1419

github

web-flow
Merge 1d9d8942c into ee5696054
Pull Request #1419: Modernize Some Public API Classes

2333 of 3154 branches covered (73.97%)

55 of 100 new or added lines in 10 files covered. (55.0%)

4 existing lines in 3 files now uncovered.

11585 of 13034 relevant lines covered (88.88%)

0.89 hits per line

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

40.27
/core/mybatis-generator-core/src/main/java/org/mybatis/generator/api/MyBatisGenerator.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 static org.mybatis.generator.internal.util.ClassloaderUtility.getCustomClassloader;
19
import static org.mybatis.generator.internal.util.messages.Messages.getString;
20

21
import java.io.BufferedWriter;
22
import java.io.File;
23
import java.io.IOException;
24
import java.io.OutputStream;
25
import java.io.OutputStreamWriter;
26
import java.nio.charset.Charset;
27
import java.nio.file.Files;
28
import java.nio.file.Path;
29
import java.nio.file.StandardOpenOption;
30
import java.sql.SQLException;
31
import java.util.ArrayList;
32
import java.util.Collection;
33
import java.util.HashSet;
34
import java.util.List;
35
import java.util.Objects;
36
import java.util.Set;
37

38
import org.jspecify.annotations.Nullable;
39
import org.mybatis.generator.codegen.CalculatedContextValues;
40
import org.mybatis.generator.codegen.GenerationEngine;
41
import org.mybatis.generator.codegen.GenerationResults;
42
import org.mybatis.generator.codegen.IntrospectionEngine;
43
import org.mybatis.generator.codegen.RootClassInfo;
44
import org.mybatis.generator.config.Configuration;
45
import org.mybatis.generator.config.Context;
46
import org.mybatis.generator.config.MergeConstants;
47
import org.mybatis.generator.exception.InternalException;
48
import org.mybatis.generator.exception.InvalidConfigurationException;
49
import org.mybatis.generator.exception.ShellException;
50
import org.mybatis.generator.internal.DefaultShellCallback;
51
import org.mybatis.generator.internal.ObjectFactory;
52
import org.mybatis.generator.internal.XmlFileMergerJaxp;
53

54
/**
55
 * This class is the main interface to MyBatis generator. A typical execution of the tool involves these steps:
56
 * <ol>
57
 * <li>Create a Configuration object. The Configuration can be the result of a parsing the XML configuration file, or it
58
 * can be created solely in Java.</li>
59
 * <li>Create a MyBatisGenerator object</li>
60
 * <li>Call one of the generate() methods</li>
61
 * </ol>
62
 *
63
 * @author Jeff Butler
64
 *
65
 * @see org.mybatis.generator.config.xml.ConfigurationParser
66
 */
67
public class MyBatisGenerator {
68
    private static final ProgressCallback NULL_PROGRESS_CALLBACK = new ProgressCallback() { };
1✔
69
    private final Configuration configuration;
70
    private final ShellCallback shellCallback;
71
    private final ProgressCallback progressCallback;
72
    private final Set<String> contextIds;
73
    private final Set<String> fullyQualifiedTableNames;
74

75
    private final List<GenerationResults> generationResultsList = new ArrayList<>();
1✔
76

77
    private MyBatisGenerator(Builder builder) {
1✔
78
        configuration = Objects.requireNonNull(builder.configuration, getString("RuntimeError.2")); //$NON-NLS-1$
1✔
79
        shellCallback = Objects.requireNonNullElseGet(builder.shellCallback, () -> new DefaultShellCallback(false));
1✔
80
        progressCallback = Objects.requireNonNullElse(builder.progressCallback, NULL_PROGRESS_CALLBACK);
1✔
81
        fullyQualifiedTableNames = builder.fullyQualifiedTableNames;
1✔
82
        contextIds = builder.contextIds;
1✔
83
    }
1✔
84

85
    /**
86
     * This is one of the main methods for generating code. This method is long-running, but progress can be provided
87
     * and the method can be canceled through the ProgressCallback interface. This method will not write results to
88
     * the disk. The generated objects can be retrieved from the getGeneratedJavaFiles(), getGeneratedKotlinFiles(),
89
     * getGeneratedXmlFiles(), and getGeneratedGenericFiles() methods.
90
     *
91
     * @return any warnings created during the generation process
92
     * @throws SQLException
93
     *             the SQL exception
94
     * @throws InterruptedException
95
     *             if the method is canceled through the ProgressCallback
96
     * @throws InvalidConfigurationException
97
     *             if the specified configuration is invalid
98
     */
99
    public List<String> generateOnly() throws SQLException, InterruptedException, InvalidConfigurationException {
100
        List<String> warnings = new ArrayList<>();
1✔
101
        generateFiles(warnings);
1✔
102
        progressCallback.done();
1✔
103
        return warnings;
1✔
104
    }
105

106
    /**
107
     * This is one of the main methods for generating code. This method is long-running, but progress can be provided
108
     * and the method can be canceled through the ProgressCallback interface. This method will write results to
109
     * the disk.
110
     *
111
     * @return any warnings created during the generation process
112
     * @throws SQLException
113
     *             the SQL exception
114
     * @throws IOException
115
     *             Signals that an I/O exception has occurred.
116
     * @throws InterruptedException
117
     *             if the method is canceled through the ProgressCallback
118
     * @throws InvalidConfigurationException
119
     *             if the specified configuration is invalid
120
     */
121
    public List<String> generateAndWrite() throws SQLException, IOException, InterruptedException,
122
            InvalidConfigurationException {
NEW
123
        List<String> warnings = new ArrayList<>();
×
NEW
124
        generateFiles(warnings);
×
NEW
125
        writeGeneratedFiles(warnings);
×
NEW
126
        progressCallback.done();
×
NEW
127
        return warnings;
×
128
    }
129

130
    private void generateFiles(List<String> warnings) throws SQLException, InterruptedException,
131
            InvalidConfigurationException {
132
        configuration.validate();
1✔
133
        generationResultsList.clear();
1✔
134
        ObjectFactory.reset();
1✔
135
        RootClassInfo.reset();
1✔
136

137
        setupCustomClassloader();
1✔
138
        List<Context> contextsToRun = calculateContextsToRun();
1✔
139
        List<CalculatedContextValues> contextValuesList = calculateContextValues(contextsToRun, warnings);
1✔
140
        runAllIntrospections(contextValuesList, warnings);
1✔
141
        List<GenerationEngine> generationEngines = createGenerationEngines(contextValuesList, warnings);
1✔
142
        runGenerationEngines(generationEngines);
1✔
143
    }
1✔
144

145
    private void setupCustomClassloader() {
146
        if (!configuration.getClassPathEntries().isEmpty()) {
1!
147
            ClassLoader classLoader = getCustomClassloader(configuration.getClassPathEntries());
×
148
            ObjectFactory.addExternalClassLoader(classLoader);
×
149
        }
150
    }
1✔
151

152
    private List<Context> calculateContextsToRun() {
153
        List<Context> contextsToRun;
154
        if (fullyQualifiedTableNames.isEmpty()) {
1!
155
            contextsToRun = configuration.getContexts();
1✔
156
        } else {
157
            contextsToRun = configuration.getContexts().stream()
×
158
                    .filter(c -> contextIds.contains(c.getId()))
×
159
                    .toList();
×
160
        }
161

162
        return contextsToRun;
1✔
163
    }
164

165
    private List<CalculatedContextValues> calculateContextValues(List<Context> contextsToRun, List<String> warnings) {
166
        return contextsToRun.stream()
1✔
167
                .map(c -> createContextValues(c, warnings))
1✔
168
                .toList();
1✔
169
    }
170

171
    private CalculatedContextValues createContextValues(Context context, List<String> warnings) {
172
        return new CalculatedContextValues.Builder()
1✔
173
                .withContext(context)
1✔
174
                .withWarnings(warnings)
1✔
175
                .build();
1✔
176
    }
177

178
    private void runAllIntrospections(List<CalculatedContextValues> contextValuesList, List<String> warnings)
179
            throws SQLException, InterruptedException {
180
        int totalSteps = contextValuesList.stream()
1✔
181
                .map(CalculatedContextValues::context)
1✔
182
                .mapToInt(Context::getIntrospectionSteps)
1✔
183
                .sum();
1✔
184
        progressCallback.introspectionStarted(totalSteps);
1✔
185

186
        for (CalculatedContextValues contextValues : contextValuesList) {
1✔
187
            contextValues.addIntrospectedTables(
1✔
188
                    runContextIntrospection(fullyQualifiedTableNames, contextValues, warnings));
1✔
189
        }
1✔
190
    }
1✔
191

192
    private List<IntrospectedTable> runContextIntrospection(Set<String> fullyQualifiedTableNames,
193
                                                            CalculatedContextValues contextValues,
194
                                                            List<String> warnings)
195
            throws SQLException, InterruptedException {
196
        return new IntrospectionEngine.Builder()
1✔
197
                .withContextValues(contextValues)
1✔
198
                .withFullyQualifiedTableNames(fullyQualifiedTableNames)
1✔
199
                .withWarnings(warnings)
1✔
200
                .withProgressCallback(progressCallback)
1✔
201
                .build()
1✔
202
                .introspectTables();
1✔
203
    }
204

205
    private List<GenerationEngine> createGenerationEngines(List<CalculatedContextValues> contextValuesList,
206
                                                           List<String> warnings) {
207
        return contextValuesList.stream()
1✔
208
                .map(c -> createGenerationEngine(c, warnings))
1✔
209
                .toList();
1✔
210
    }
211

212
    private GenerationEngine createGenerationEngine(CalculatedContextValues contextValues, List<String> warnings) {
213
        return new GenerationEngine.Builder()
1✔
214
                .withContextValues(contextValues)
1✔
215
                .withProgressCallback(progressCallback)
1✔
216
                .withWarnings(warnings)
1✔
217
                .withIntrospectedTables(contextValues.introspectedTables())
1✔
218
                .build();
1✔
219
    }
220

221
    private void runGenerationEngines(List<GenerationEngine> generationEngines) throws InterruptedException {
222
        // calculate the number of steps
223
        int totalSteps = generationEngines.stream().mapToInt(GenerationEngine::getGenerationSteps).sum();
1✔
224
        progressCallback.generationStarted(totalSteps);
1✔
225

226
        // now run the generators
227
        for (GenerationEngine generationEngine: generationEngines) {
1✔
228
            var generationResults = generationEngine.generate();
1✔
229
            generationResultsList.add(generationResults);
1✔
230
        }
1✔
231
    }
1✔
232

233
    private void writeGeneratedFiles(List<String> warnings) throws IOException, InterruptedException {
234
        Set<String> projects = new HashSet<>();
×
235
        int totalSteps = generationResultsList.stream().mapToInt(GenerationResults::getNumberOfGeneratedFiles).sum();
×
236
        progressCallback.saveStarted(totalSteps);
×
237

238
        for (GenerationResults generationResults : generationResultsList) {
×
239
            for (GeneratedXmlFile gxf : generationResults.generatedXmlFiles()) {
×
240
                projects.add(gxf.getTargetProject());
×
NEW
241
                writeGeneratedXmlFile(gxf, generationResults.xmlFormatter(), warnings);
×
242
            }
×
243

244
            for (GeneratedJavaFile gjf : generationResults.generatedJavaFiles()) {
×
245
                projects.add(gjf.getTargetProject());
×
246
                writeGeneratedJavaFile(gjf, generationResults.javaFormatter(), generationResults.javaFileEncoding(),
×
247
                        warnings);
248
            }
×
249

250
            for (GeneratedKotlinFile gkf : generationResults.generatedKotlinFiles()) {
×
251
                projects.add(gkf.getTargetProject());
×
252
                writeGeneratedKotlinFile(gkf, generationResults.kotlinFormatter(),
×
NEW
253
                        generationResults.kotlinFileEncoding(), warnings);
×
UNCOV
254
            }
×
255

256
            for (GenericGeneratedFile gf : generationResults.generatedGenericFiles()) {
×
257
                projects.add(gf.getTargetProject());
×
NEW
258
                writeGenericGeneratedFile(gf, warnings);
×
259
            }
×
260
        }
×
261

262
        for (String project : projects) {
×
263
            shellCallback.refreshProject(project);
×
264
        }
×
265
    }
×
266

267
    private void writeGeneratedJavaFile(GeneratedJavaFile gjf, JavaFormatter javaFormatter,
268
                                        @Nullable String javaFileEncoding, List<String> warnings)
269
            throws InterruptedException, IOException {
270
        Path targetFile;
271
        String source = javaFormatter.getFormattedContent(gjf.getCompilationUnit());
×
272
        try {
273
            File directory = shellCallback.getDirectory(gjf.getTargetProject(), gjf.getTargetPackage());
×
274
            targetFile = directory.toPath().resolve(gjf.getFileName());
×
275
            if (Files.exists(targetFile)) {
×
276
                if (shellCallback.isMergeSupported()) {
×
277
                    source = shellCallback.mergeJavaFile(source, targetFile.toFile(),
×
278
                            MergeConstants.getOldElementTags(), javaFileEncoding);
×
279
                } else if (shellCallback.isOverwriteEnabled()) {
×
280
                    warnings.add(getString("Warning.11", targetFile.toFile().getAbsolutePath())); //$NON-NLS-1$
×
281
                } else {
282
                    targetFile = getUniqueFileName(directory, gjf.getFileName());
×
283
                    warnings.add(getString("Warning.2", targetFile.toFile().getAbsolutePath())); //$NON-NLS-1$
×
284
                }
285
            }
286

287
            progressCallback.checkCancel();
×
288
            progressCallback.startTask(getString("Progress.15", targetFile.toString())); //$NON-NLS-1$
×
289
            writeFile(targetFile.toFile(), source, javaFileEncoding);
×
290
        } catch (ShellException e) {
×
291
            warnings.add(e.getMessage());
×
292
        }
×
293
    }
×
294

295
    private void writeGeneratedKotlinFile(GeneratedKotlinFile gf, KotlinFormatter kotlinFormatter,
296
                                          @Nullable String kotlinFileEncoding, List<String> warnings)
297
            throws InterruptedException, IOException {
298
        Path targetFile;
299
        String source = kotlinFormatter.getFormattedContent(gf.getKotlinFile());
×
300
        try {
301
            File directory = shellCallback.getDirectory(gf.getTargetProject(), gf.getTargetPackage());
×
302
            targetFile = directory.toPath().resolve(gf.getFileName());
×
303
            if (Files.exists(targetFile)) {
×
304
                if (shellCallback.isOverwriteEnabled()) {
×
305
                    warnings.add(getString("Warning.11", targetFile.toFile().getAbsolutePath())); //$NON-NLS-1$
×
306
                } else {
307
                    targetFile = getUniqueFileName(directory, gf.getFileName());
×
308
                    warnings.add(getString("Warning.2", targetFile.toFile().getAbsolutePath())); //$NON-NLS-1$
×
309
                }
310
            }
311

312
            progressCallback.checkCancel();
×
313
            progressCallback.startTask(getString("Progress.15", targetFile.toString())); //$NON-NLS-1$
×
314
            writeFile(targetFile.toFile(), source, kotlinFileEncoding);
×
315
        } catch (ShellException e) {
×
316
            warnings.add(e.getMessage());
×
317
        }
×
318
    }
×
319

320
    private void writeGenericGeneratedFile(GenericGeneratedFile gf, List<String> warnings)
321
            throws InterruptedException, IOException {
322
        Path targetFile;
323
        String source = gf.getFormattedContent();
×
324
        try {
325
            File directory = shellCallback.getDirectory(gf.getTargetProject(), gf.getTargetPackage());
×
326
            targetFile = directory.toPath().resolve(gf.getFileName());
×
327
            if (Files.exists(targetFile)) {
×
328
                if (shellCallback.isOverwriteEnabled()) {
×
329
                    warnings.add(getString("Warning.11", targetFile.toFile().getAbsolutePath())); //$NON-NLS-1$
×
330
                } else {
331
                    targetFile = getUniqueFileName(directory, gf.getFileName());
×
332
                    warnings.add(getString("Warning.2", targetFile.toFile().getAbsolutePath())); //$NON-NLS-1$
×
333
                }
334
            }
335

336
            progressCallback.checkCancel();
×
337
            progressCallback.startTask(getString("Progress.15", targetFile.toString())); //$NON-NLS-1$
×
338
            writeFile(targetFile.toFile(), source, gf.getFileEncoding().orElse(null));
×
339
        } catch (ShellException e) {
×
340
            warnings.add(e.getMessage());
×
341
        }
×
342
    }
×
343

344
    private void writeGeneratedXmlFile(GeneratedXmlFile gxf, XmlFormatter xmlFormatter, List<String> warnings)
345
            throws InterruptedException, IOException {
346
        Path targetFile;
347
        String source = xmlFormatter.getFormattedContent(gxf.getDocument());
×
348
        try {
349
            File directory = shellCallback.getDirectory(gxf.getTargetProject(), gxf.getTargetPackage());
×
350
            targetFile = directory.toPath().resolve(gxf.getFileName());
×
351
            if (Files.exists(targetFile)) {
×
352
                if (gxf.isMergeable()) {
×
353
                    source = XmlFileMergerJaxp.getMergedSource(source, targetFile.toFile());
×
354
                } else if (shellCallback.isOverwriteEnabled()) {
×
355
                    warnings.add(getString("Warning.11", targetFile.toFile().getAbsolutePath())); //$NON-NLS-1$
×
356
                } else {
357
                    targetFile = getUniqueFileName(directory, gxf.getFileName());
×
358
                    warnings.add(getString("Warning.2", targetFile.toFile().getAbsolutePath())); //$NON-NLS-1$
×
359
                }
360
            }
361

362
            progressCallback.checkCancel();
×
363
            progressCallback.startTask(getString("Progress.15", targetFile.toString())); //$NON-NLS-1$
×
364
            writeFile(targetFile.toFile(), source, "UTF-8"); //$NON-NLS-1$
×
365
        } catch (ShellException e) {
×
366
            warnings.add(e.getMessage());
×
367
        }
×
368
    }
×
369

370
    /**
371
     * Writes, or overwrites, the contents of the specified file.
372
     *
373
     * @param file
374
     *            the file
375
     * @param content
376
     *            the content
377
     * @param fileEncoding
378
     *            the file encoding
379
     * @throws IOException
380
     *             Signals that an I/O exception has occurred.
381
     */
382
    private void writeFile(File file, String content, @Nullable String fileEncoding) throws IOException {
383
        try (OutputStream fos = Files.newOutputStream(file.toPath(), StandardOpenOption.CREATE,
×
384
                StandardOpenOption.TRUNCATE_EXISTING)) {
385
            OutputStreamWriter osw;
386
            if (fileEncoding == null) {
×
387
                osw = new OutputStreamWriter(fos);
×
388
            } else {
389
                osw = new OutputStreamWriter(fos, Charset.forName(fileEncoding));
×
390
            }
391

392
            try (BufferedWriter bw = new BufferedWriter(osw)) {
×
393
                bw.write(content);
×
394
            }
395
        }
396
    }
×
397

398
    /**
399
     * Gets the unique file name.
400
     *
401
     * @param directory
402
     *            the directory
403
     * @param fileName
404
     *            the file name
405
     * @return the unique file name
406
     */
407
    private Path getUniqueFileName(File directory, String fileName) {
408
        Path answer = null;
×
409

410
        // try up to 1000 times to generate a unique file name
411
        StringBuilder sb = new StringBuilder();
×
412
        for (int i = 1; i < 1000; i++) {
×
413
            sb.setLength(0);
×
414
            sb.append(fileName);
×
415
            sb.append('.');
×
416
            sb.append(i);
×
417

418
            Path testFile = directory.toPath().resolve(sb.toString());
×
419
            if (Files.notExists(testFile)) {
×
420
                answer = testFile;
×
421
                break;
×
422
            }
423
        }
424

425
        if (answer == null) {
×
426
            throw new InternalException(getString("RuntimeError.3", directory.getAbsolutePath())); //$NON-NLS-1$
×
427
        }
428

429
        return answer;
×
430
    }
431

432
    /**
433
     * Returns the list of generated Java files after a call to one of the generate methods.
434
     * This is useful if you prefer to process the generated files yourself and do not want
435
     * the generator to write them to disk.
436
     *
437
     * @return the list of generated Java files
438
     */
439
    public List<GeneratedJavaFile> getGeneratedJavaFiles() {
440
        return generationResultsList.stream()
1✔
441
                .map(GenerationResults::generatedJavaFiles)
1✔
442
                .flatMap(Collection::stream)
1✔
443
                .toList();
1✔
444
    }
445

446
    /**
447
     * Returns the list of generated Kotlin files after a call to one of the generate methods.
448
     * This is useful if you prefer to process the generated files yourself and do not want
449
     * the generator to write them to disk.
450
     *
451
     * @return the list of generated Kotlin files
452
     */
453
    public List<GeneratedKotlinFile> getGeneratedKotlinFiles() {
454
        return generationResultsList.stream()
1✔
455
                .map(GenerationResults::generatedKotlinFiles)
1✔
456
                .flatMap(Collection::stream)
1✔
457
                .toList();
1✔
458
    }
459

460
    /**
461
     * Returns the list of generated XML files after a call to one of the generate methods.
462
     * This is useful if you prefer to process the generated files yourself and do not want
463
     * the generator to write them to disk.
464
     *
465
     * @return the list of generated XML files
466
     */
467
    public List<GeneratedXmlFile> getGeneratedXmlFiles() {
468
        return generationResultsList.stream()
1✔
469
                .map(GenerationResults::generatedXmlFiles)
1✔
470
                .flatMap(Collection::stream)
1✔
471
                .toList();
1✔
472
    }
473

474
    /**
475
     * Returns the list of generated generic files after a call to one of the generate methods.
476
     * This is useful if you prefer to process the generated files yourself and do not want
477
     * the generator to write them to disk.
478
     *
479
     * <p>The list will be empty unless you have used a plugin that generates generic files
480
     * or are using a custom runtime.
481
     *
482
     * @return the list of generated generic files
483
     */
484
    public List<GenericGeneratedFile> getGeneratedGenericFiles() {
485
        return generationResultsList.stream()
×
486
                .map(GenerationResults::generatedGenericFiles)
×
487
                .flatMap(Collection::stream)
×
488
                .toList();
×
489
    }
490

491
    public static class Builder {
1✔
492
        private @Nullable Configuration configuration;
493
        private @Nullable ShellCallback shellCallback;
494
        private @Nullable ProgressCallback progressCallback;
495
        private final Set<String> contextIds = new HashSet<>();
1✔
496
        private final Set<String> fullyQualifiedTableNames = new HashSet<>();
1✔
497

498
        public Builder withConfiguration(Configuration configuration) {
499
            this.configuration = configuration;
1✔
500
            return this;
1✔
501
        }
502

503
        public Builder withShellCallback(ShellCallback shellCallback) {
504
            this.shellCallback = shellCallback;
1✔
505
            return this;
1✔
506
        }
507

508
        public Builder withProgressCallback(@Nullable ProgressCallback progressCallback) {
NEW
509
            this.progressCallback = progressCallback;
×
NEW
510
            return this;
×
511
        }
512

513
        /**
514
         * Set of context IDs to use in generation. Only the contexts with an id specified in this set will run.
515
         * If the set is empty, then all contexts are run.
516
         *
517
         * @param contextIds
518
         *            a set of contextIds to use in code generation
519
         *
520
         * @return this builder
521
         */
522
        public Builder withContextIds(Set<String> contextIds) {
NEW
523
            this.contextIds.addAll(contextIds);
×
NEW
524
            return this;
×
525
        }
526

527
        /**
528
         *  Set of table names to generate. The elements of the set must be Strings that exactly match what's
529
         *  specified in the configuration. For example, if a table name = "foo" and schema = "bar", then the fully
530
         *  qualified table name is "foo.bar". If the Set is empty, then all tables in the configuration
531
         *  will be used for code generation.
532
         *
533
         * @param fullyQualifiedTableNames
534
         *            a set of table names to use in code generation
535
         *
536
         * @return this builder
537
         */
538
        public Builder withFullyQualifiedTableNames(Set<String> fullyQualifiedTableNames) {
NEW
539
            this.fullyQualifiedTableNames.addAll(fullyQualifiedTableNames);
×
NEW
540
            return this;
×
541
        }
542

543
        public MyBatisGenerator build() {
544
            return new MyBatisGenerator(this);
1✔
545
        }
546
    }
547
}
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