Search in sources :

Example 1 with Product

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

the class ProductDaoTest method update.

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

Example 2 with Product

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

the class ProductDaoTest method delete.

@Test
public void delete() {
    Product product = new Product();
    product.setSupplier(supplierDao.findById(1));
    product.setName("ProductX");
    product.setLocalizations(ImmutableSet.of(new ProductL10n()));
    productDao.save(product);
    assertNotNull(productDao.findById(product.getId()));
    productDao.delete(product);
    assertNull(productDao.findById(product.getId()));
}
Also used : Product(com.querydsl.example.dto.Product) ProductL10n(com.querydsl.example.dto.ProductL10n) Test(org.junit.Test)

Aggregations

Product (com.querydsl.example.dto.Product)2 Test (org.junit.Test)2 ProductL10n (com.querydsl.example.dto.ProductL10n)1