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

mybatis / mybatis-3 / 3081

26 Dec 2025 06:25PM UTC coverage: 87.396% (+0.01%) from 87.382%
3081

Pull #3579

github

web-flow
Merge 1da72b86e into 17d9f882a
Pull Request #3579: Reduce the memory usage of inline ResultMap

3845 of 4659 branches covered (82.53%)

20 of 20 new or added lines in 4 files covered. (100.0%)

9 existing lines in 3 files now uncovered.

9957 of 11393 relevant lines covered (87.4%)

0.87 hits per line

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

94.12
/src/main/java/org/apache/ibatis/mapping/ParameterMap.java
1
/*
2
 *    Copyright 2009-2023 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.apache.ibatis.mapping;
17

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

21
import org.apache.ibatis.session.Configuration;
22

23
/**
24
 * @author Clinton Begin
25
 */
26
public class ParameterMap {
27

28
  private String id;
29
  private Class<?> type;
30
  private List<ParameterMapping> parameterMappings;
31

32
  private ParameterMap() {
33
  }
34

35
  public static ParameterMap inline(String statementId, Class<?> parameterType) {
36
    ParameterMap inlineParameterMap = new ParameterMap();
1✔
37
    inlineParameterMap.id = statementId + "-Inline";
1✔
38
    inlineParameterMap.type = parameterType;
1✔
39
    // lock down collections
40
    inlineParameterMap.parameterMappings = Collections.emptyList();
1✔
41
    return inlineParameterMap;
1✔
42
  }
43

44
  public static class Builder {
45
    private final ParameterMap parameterMap = new ParameterMap();
1✔
46

47
    public Builder(Configuration configuration, String id, Class<?> type, List<ParameterMapping> parameterMappings) {
1✔
48
      parameterMap.id = id;
1✔
49
      parameterMap.type = type;
1✔
50
      parameterMap.parameterMappings = parameterMappings;
1✔
51
    }
1✔
52

53
    public Class<?> type() {
UNCOV
54
      return parameterMap.type;
×
55
    }
56

57
    public ParameterMap build() {
58
      // lock down collections
59
      parameterMap.parameterMappings = Collections.unmodifiableList(parameterMap.parameterMappings);
1✔
60
      return parameterMap;
1✔
61
    }
62
  }
63

64
  public String getId() {
65
    return id;
1✔
66
  }
67

68
  public Class<?> getType() {
69
    return type;
1✔
70
  }
71

72
  public List<ParameterMapping> getParameterMappings() {
73
    return parameterMappings;
1✔
74
  }
75

76
}
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

© 2025 Coveralls, Inc