Package org.springmodules.samples.jsr94.model

Examples of org.springmodules.samples.jsr94.model.Car


    /**
     * @see org.springframework.jdbc.object.MappingSqlQuery#mapRow(java.sql.ResultSet, int)
     */
    protected Object mapRow(ResultSet rs, int pos) throws SQLException {
      Car car=new Car();
      car.setId(rs.getInt("car_id"));
      car.setName(rs.getString("car_name"));
      car.setMark(rs.getString("car_mark"));
      car.setModel(rs.getString("car_model"));
      car.setYear(rs.getInt("car_year"));
      car.setPrice(rs.getFloat("car_price"));
      return car;
    }
View Full Code Here


public class TestJSR94 {
  private static final Log log = LogFactory.getLog(TestJSR94.class);

  private static void showCars(List cars) {
    for(Iterator i=cars.iterator();i.hasNext();) {
      Car car=(Car)i.next();
      log.info("## "+car.getName()+" ("+car.getId()+")");
      log.info("    - "+car.getMark());
      log.info("    - "+car.getModel());
      log.info("    - "+car.getYear());
      log.info("    - "+car.getPrice());
    }
  }
View Full Code Here

  private void showListCars(List cars) {
    for(Iterator i=cars.iterator();i.hasNext();) {
      Object o=i.next();
      System.out.println("## o = "+o+" - "+Car.class.toString());
      Car car=(Car)o;
      System.out.println(" - goodBargain = "+car.isGoodBargain());
    }
  }
View Full Code Here

        return session.executeRules(cars);
      }
    });
    List goodBargainCars=new ArrayList();
    for(Iterator i=cars.iterator();i.hasNext();) {
      Car car=(Car)i.next();
      if( car.isGoodBargain() )
        goodBargainCars.add(car);
    }
    return goodBargainCars;
  }
View Full Code Here

   */
  public static void main(String[] args) {
    ClassPathXmlApplicationContext ctx=null;
    try {
      ctx=new ClassPathXmlApplicationContext(getContextEngine(args));
      CarsService service=(CarsService)ctx.getBean("carsService");
      showGoodBargainCars(service);
    } catch(Exception ex) {
      ex.printStackTrace();
      log.error("Error during execution",ex);
    } finally {
View Full Code Here

TOP

Related Classes of org.springmodules.samples.jsr94.model.Car

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.