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

mybatis / ibatis-2 / 678

27 Dec 2025 01:13AM UTC coverage: 65.584% (+0.05%) from 65.532%
678

push

github

hazendaz
Merge remote-tracking branch 'upstream/master' into support-javax

1606 of 2810 branches covered (57.15%)

167 of 305 new or added lines in 90 files covered. (54.75%)

6 existing lines in 4 files now uncovered.

5067 of 7726 relevant lines covered (65.58%)

0.66 hits per line

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

37.5
/src/main/java/com/ibatis/sqlmap/engine/type/BigDecimalTypeHandler.java
1
/*
2
 * Copyright 2004-2025 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 com.ibatis.sqlmap.engine.type;
17

18
import java.math.BigDecimal;
19
import java.sql.CallableStatement;
20
import java.sql.PreparedStatement;
21
import java.sql.ResultSet;
22
import java.sql.SQLException;
23

24
/**
25
 * BigDecimal implementation of TypeHandler.
26
 */
27
public class BigDecimalTypeHandler extends BaseTypeHandler implements TypeHandler {
1✔
28

29
  @Override
30
  public void setParameter(PreparedStatement ps, int i, Object parameter, String jdbcType) throws SQLException {
31
    ps.setBigDecimal(i, (BigDecimal) parameter);
1✔
32
  }
1✔
33

34
  @Override
35
  public Object getResult(ResultSet rs, String columnName) throws SQLException {
36
    Object bigdec = rs.getBigDecimal(columnName);
1✔
37
    if (rs.wasNull()) {
1!
38
      return null;
×
39
    }
40
    return bigdec;
1✔
41
  }
42

43
  @Override
44
  public Object getResult(ResultSet rs, int columnIndex) throws SQLException {
45
    Object bigdec = rs.getBigDecimal(columnIndex);
×
46
    if (rs.wasNull()) {
×
47
      return null;
×
48
    }
NEW
49
    return bigdec;
×
50
  }
51

52
  @Override
53
  public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
54
    Object bigdec = cs.getBigDecimal(columnIndex);
×
55
    if (cs.wasNull()) {
×
56
      return null;
×
57
    }
NEW
58
    return bigdec;
×
59
  }
60

61
  @Override
62
  public Object valueOf(String s) {
NEW
63
    return java.math.BigDecimal.valueOf(Long.parseLong(s));
×
64
  }
65

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