Package com.expositds.ars.dao.entity.user

Examples of com.expositds.ars.dao.entity.user.CustomerEntity


  @Override
  public Customer updateCustomer(Customer customer) {
    Customer result = null;

    CustomerEntity customerEntity = DozerHelper.map(customer,
        CustomerEntity.class);
    customerEntity = customerRepository.merge(customerEntity);
    result = DozerHelper.map(customerEntity, Customer.class);

    return result;
View Full Code Here


    return result;
  }

  @Override
  public void deleteCustomer(Customer customer) {
    CustomerEntity customerEntity = DozerHelper.map(customer,
        CustomerEntity.class);
    customerRepository.delete(customerEntity);
  }
View Full Code Here

  @Override
  public Customer getCustomerById(Long id) {
    Customer result = null;

    CustomerEntity customerEntity = customerRepository.findById(id);
    result = DozerHelper.map(customerEntity, Customer.class);

    return result;
  }
View Full Code Here

  @Override
  public Customer getCustomerByVehicleRegNo(String vehicleRegNo) {
    Customer result = null;

    CustomerEntity customerEntity = customerRepository
        .finByVehicleRegNo(vehicleRegNo);
    result = DozerHelper.map(customerEntity, Customer.class);

    return result;
  }
View Full Code Here

    if (page != null) {
      position = (page - 1) * ORDERS_PER_PAGE;
      amount = ORDERS_PER_PAGE;
    }

    CustomerEntity customerEntity = DozerHelper.map(customer,
        CustomerEntity.class);

    List<OrderEntity> orderEntities = orderRepository.findByCustomer(
        customerEntity, status, amount, position);
    result = DozerHelper.mapList(orderEntities, Order.class);
View Full Code Here

  @Override
  public List<Order> getLastOrders(Customer customer, int amount) {
    List<Order> result = null;

    CustomerEntity customerEntity = DozerHelper.map(customer,
        CustomerEntity.class);

    List<OrderEntity> orderEntities = orderRepository.findByCustomer(
        customerEntity, null, amount, null);
    result = DozerHelper.mapList(orderEntities, Order.class);
View Full Code Here

    AbstractHibernateDao<CustomerEntity, Long> implements ICustomerDao {

  // TODO: test it
  @Override
  public CustomerEntity findByCar(CarEntity carEntity) {
    CustomerEntity result = null;

    Criteria cr = getSession().createCriteria(CustomerEntity.class).add(
        Restrictions.eq("cars", carEntity));
    result = findUniqueByCriteria(cr);
View Full Code Here

    return result;
  }

  public CustomerEntity finByVehicleRegNo(String vehicleRegNo) {
    CustomerEntity result = null;

    Criteria cr = getSession().createCriteria(CustomerEntity.class)
        .createCriteria("cars")
        .add(Restrictions.eq("vehicleRegNo", vehicleRegNo));
    result = findUniqueByCriteria(cr);
View Full Code Here

    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);

    log.info("Getting subsidiary entity and mapping subsidiary model.");
    List<SubsidiaryEntity> subsidiaryEntity = null;
    subsidiaryEntity = subsidiaryRepository.findByName("ARS Grodno");
View Full Code Here

TOP

Related Classes of com.expositds.ars.dao.entity.user.CustomerEntity

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.