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

mybatis / guice / #1210

04 Nov 2023 08:23PM CUT coverage: 80.045%. Remained the same
#1210

Pull #633

github

web-flow
Merge 9d1860fb9 into 408340d1e
Pull Request #633: [pom] Sortpom

1408 of 1759 relevant lines covered (80.05%)

0.8 hits per line

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

62.5
/src/main/java/org/mybatis/guice/session/SqlSessionManagerProvider.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.mybatis.guice.session;
17

18
import static org.apache.ibatis.session.SqlSessionManager.newInstance;
19

20
import jakarta.inject.Inject;
21
import jakarta.inject.Provider;
22
import jakarta.inject.Singleton;
23

24
import org.apache.ibatis.session.SqlSessionFactory;
25
import org.apache.ibatis.session.SqlSessionManager;
26

27
@Singleton
28
public final class SqlSessionManagerProvider implements Provider<SqlSessionManager> {
29

30
  private SqlSessionManager sqlSessionManager;
31

32
  /**
33
   * @since 1.0.1
34
   */
35
  public SqlSessionManagerProvider() {
1✔
36
    // do nothing
37
  }
1✔
38

39
  @Deprecated
40
  public SqlSessionManagerProvider(SqlSessionFactory sqlSessionFactory) {
×
41
    this.sqlSessionManager = newInstance(sqlSessionFactory);
×
42
  }
×
43

44
  /**
45
   * Creates the new sql session manager.
46
   *
47
   * @param sqlSessionFactory
48
   *          the sql session factory
49
   *
50
   * @since 1.0.1
51
   */
52
  @Inject
53
  public void createNewSqlSessionManager(SqlSessionFactory sqlSessionFactory) {
54
    this.sqlSessionManager = newInstance(sqlSessionFactory);
1✔
55
  }
1✔
56

57
  @Override
58
  public SqlSessionManager get() {
59
    return sqlSessionManager;
1✔
60
  }
61

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