Search in sources :

Example 1 with Order

use of com.querydsl.example.dto.Order in project querydsl by querydsl.

the class OrderDaoTest method update.

@Test
public void update() {
    Order order = orderDao.findById(1);
    orderDao.save(order);
}
Also used : Order(com.querydsl.example.dto.Order) Test(org.junit.Test)

Example 2 with Order

use of com.querydsl.example.dto.Order in project querydsl by querydsl.

the class OrderDaoTest method delete.

@Test
public void delete() {
    OrderProduct orderProduct = new OrderProduct();
    orderProduct.setProductId(1L);
    orderProduct.setQuantity(1);
    // FIXME
    CustomerPaymentMethod paymentMethod = new CustomerPaymentMethod();
    Order order = new Order();
    order.setCustomerPaymentMethod(paymentMethod);
    order.setOrderProducts(Collections.singleton(orderProduct));
    orderDao.save(order);
    assertNotNull(order.getId());
    orderDao.delete(order);
    assertNull(orderDao.findById(order.getId()));
}
Also used : CustomerPaymentMethod(com.querydsl.example.dto.CustomerPaymentMethod) Order(com.querydsl.example.dto.Order) OrderProduct(com.querydsl.example.dto.OrderProduct) Test(org.junit.Test)

Aggregations

Order (com.querydsl.example.dto.Order)2 Test (org.junit.Test)2 CustomerPaymentMethod (com.querydsl.example.dto.CustomerPaymentMethod)1 OrderProduct (com.querydsl.example.dto.OrderProduct)1