1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.submitted.primitive_result_type;
17
18 import java.math.BigDecimal;
19 import java.util.List;
20
21 import org.apache.ibatis.session.SqlSession;
22
23 public final class ProductDAO {
24
25 public static List<Integer> selectProductCodes() {
26 try (SqlSession session = IbatisConfig.getSession()) {
27 ProductMapper productMapper = session.getMapper(ProductMapper.class);
28 return productMapper.selectProductCodes();
29 } catch (Exception e) {
30 throw new RuntimeException(e);
31 }
32 }
33
34 public static List<Long> selectProductCodesL() {
35 try (SqlSession session = IbatisConfig.getSession()) {
36 ProductMapper productMapper = session.getMapper(ProductMapper.class);
37 return productMapper.selectProductCodesL();
38 } catch (Exception e) {
39 throw new RuntimeException(e);
40 }
41 }
42
43 public static List<BigDecimal> selectProductCodesB() {
44 try (SqlSession session = IbatisConfig.getSession()) {
45 ProductMapper productMapper = session.getMapper(ProductMapper.class);
46 return productMapper.selectProductCodesB();
47 } catch (Exception e) {
48 throw new RuntimeException(e);
49 }
50 }
51
52 public static List<Product> selectAllProducts() {
53 try (SqlSession session = IbatisConfig.getSession()) {
54 ProductMapper productMapper = session.getMapper(ProductMapper.class);
55 return productMapper.selectAllProducts();
56 } catch (Exception e) {
57 throw new RuntimeException(e);
58 }
59 }
60
61 private ProductDAO() {
62 }
63
64 }