Package com.expositds.ars.dao.entity.order

Examples of com.expositds.ars.dao.entity.order.CarEntity


  // ===== Basic operations ===== //
  @Override
  public Long addCar(Car car) {
    Long result = null;

    CarEntity carEntity = DozerHelper.map(car, CarEntity.class);
    result = carRepository.save(carEntity);

    return result;
  }
View Full Code Here


  @Override
  public Car updateCar(Car car) {
    Car result = null;

    CarEntity carEntity = DozerHelper.map(car, CarEntity.class);
    carEntity = carRepository.merge(carEntity);
    result = DozerHelper.map(carEntity, Car.class);

    return result;
  }
View Full Code Here

    return result;
  }

  @Override
  public void deleteCar(Car car) {
    CarEntity carEntity = DozerHelper.map(car, CarEntity.class);
    carRepository.delete(carEntity);
  }
View Full Code Here

  @Override
  public Car getCarById(Long id) {
    Car result = null;

    CarEntity carEntity = carRepository.findById(id);
    result = DozerHelper.map(carEntity, Car.class);

    return result;
  }
View Full Code Here

  @Override
  public Car getCarByVehicleRegNo(String vehicleRegNo) {
    Car result = null;

    CarEntity carEntity = carRepository.findByVehicleRegNo(vehicleRegNo);
    result = DozerHelper.map(carEntity, Car.class);

    return result;
  }
View Full Code Here

public class CarRepository extends AbstractHibernateDao<CarEntity, Long>
    implements ICarDao {

  @Override
  public CarEntity findByVehicleRegNo(String vehicleRegNo) {
    CarEntity result = null;

    Criterion crVehicleRegNo = Restrictions
        .eq("vehicleRegNo", vehicleRegNo);
    result = findUniqueByCriteria(crVehicleRegNo);
View Full Code Here

  @Test
  public void OrderLifecycleTest() {

    log.info("Getting car entity and mapping car model.");
    CarEntity carEntity = carRepository.findByVehicleRegNo("AB2331");
    Car car = DozerHelper.map(carEntity, Car.class);

    log.info("Getting customer entity and mapping customer model.");
    CustomerEntity customerEntity = customerRepository.findById((long) 9);
    Customer customer = DozerHelper.mapAbstract(customerEntity);
View Full Code Here

TOP

Related Classes of com.expositds.ars.dao.entity.order.CarEntity

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.