示例#1
0
 @Before
 public void setUp() throws Exception {
   sqlSession = MybatisConnectionFactory.getSqlSessionFactory().openSession();
   productMapper = sqlSession.getMapper(ProductMapper.class);
   priceMapper = sqlSession.getMapper(PriceMapper.class);
   setUpAppleJuice();
   productMapper.createProduct(new Product("orange juice", "bad"));
 }
示例#2
0
 private void setUpAppleJuice() {
   appleJuice = new Product("apple juice", "good");
   productMapper.createProduct(appleJuice);
   appleJuicePrice = new Price(120, "kiwi", new Timestamp(114, 1, 1, 0, 0, 0, 0));
   priceMapper.createPrice(appleJuice, appleJuicePrice);
 }