public ProductStock mapRow(ResultSet resultSet, int arg1) throws SQLException { ProductStock productStock = new ProductStock(); Product product = new Product(); product.setProductId(resultSet.getLong("product_id")); productStock.setGoodBalance(resultSet.getLong("good_balance")); productStock.setDefBalance(resultSet.getLong("def_balance")); productStock.setProduct(product); return productStock; }
@Override public void updateProductStock(ProductStock productStock) throws OmsDataAccessException { try { jdbcTemplate.update( updateProductStockQuery, new Object[] { productStock.getGoodBalance(), productStock.getDefBalance(), productStock.getProduct().getProductId() }); } catch (DataAccessException dae) { throw new OmsDataAccessException(dae); } }
public ProductStock mapRow(ResultSet resultSet, int arg1) throws SQLException { ProductStock productStock = new ProductStock(); productStock.setId(resultSet.getLong("id")); productStock.setGoodBalance(resultSet.getLong("good_balance")); productStock.setDefBalance(resultSet.getLong("def_balance")); productStock.setLastModified(resultSet.getString("last_modified")); Product product = new Product(); product.setProductId(resultSet.getLong("product_id")); product.setProductName(resultSet.getString("product_name")); Category category = new Category(); category.setCategoryId(resultSet.getLong("category_id")); category.setCategoryName(resultSet.getString("category_name")); product.setCategory(category); productStock.setProduct(product); return productStock; }