Package com.fengjing.framework.spring.jdbc.model

Examples of com.fengjing.framework.spring.jdbc.model.Product


   
    return getJdbcTemplate().queryForObject("select * from product where id = ? ", new ParameterizedSingleColumnRowMapper<Product>(){
     
      @Override
      public Product mapRow(ResultSet rs, int rowNum) throws SQLException {
        Product product=new Product();
        product.setId(rs.getInt(1));
        product.setName(rs.getString(2));
        product.setPrice(rs.getFloat(3));
        product.setDescription(rs.getString(4));
        product.setCategoryid(rs.getString(5));
        return product;
      }
     
    },id);
   
View Full Code Here


  @Resource(name="jdbcProductServiceImpl")
  ProductService productService;
 
  @Test
  public void save(){
    Product product=new Product();
    product.setName("SONY 3d��ʵ�");
    product.setPrice(79.0f);
    product.setDescription("SONY");
    product.setCategoryid("3");
    productService.save(product);
  }
View Full Code Here

  }
 
 
  @Test
  public void getProduct(){
    Product product=productService.findById(3);
    System.out.println(product.getName()+"\t"+product.getDescription());
  }
View Full Code Here

TOP

Related Classes of com.fengjing.framework.spring.jdbc.model.Product

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.