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

mybatis / generator / 1947

14 Jan 2026 02:31PM UTC coverage: 88.838% (+0.04%) from 88.799%
1947

push

github

web-flow
Merge pull request #1411 from mybatis/renovate/github-codeql-action-digest

Update github/codeql-action digest to cdefb33

2347 of 3184 branches covered (73.71%)

11517 of 12964 relevant lines covered (88.84%)

0.89 hits per line

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

85.71
/core/mybatis-generator-core/src/main/java/org/mybatis/generator/api/GeneratedJavaFile.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 org.mybatis.generator.api.dom.java.CompilationUnit;
19

20
public class GeneratedJavaFile extends GeneratedFile {
21

22
    private final CompilationUnit compilationUnit;
23

24
    public GeneratedJavaFile(CompilationUnit compilationUnit, String targetProject) {
25
        super(targetProject);
1✔
26
        this.compilationUnit = compilationUnit;
1✔
27
    }
1✔
28

29
    @Override
30
    public String getFileName() {
31
        return compilationUnit.getType().getShortNameWithoutTypeArguments() + ".java"; //$NON-NLS-1$
1✔
32
    }
33

34
    @Override
35
    public String getTargetPackage() {
36
        return compilationUnit.getType().getPackageName();
1✔
37
    }
38

39
    /**
40
     * This method is required by the Eclipse Java merger. If you are not
41
     * running in Eclipse, or some other system that implements the Java merge
42
     * function, you may return null from this method.
43
     *
44
     * @return the CompilationUnit associated with this file, or null if the
45
     *         file is not mergeable.
46
     */
47
    public CompilationUnit getCompilationUnit() {
48
        return compilationUnit;
1✔
49
    }
50

51
    /**
52
     * A Java file is mergeable if the getCompilationUnit() method returns a valid compilation unit.
53
     *
54
     * @return true, if is mergeable
55
     */
56
    @Override
57
    public boolean isMergeable() {
58
        return true;
×
59
    }
60
}
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