Search in sources :

Example 1 with Product

use of com.querydsl.jdo.test.domain.Product in project querydsl by querydsl.

the class JDOSQLQueryTest method entityProjections.

@Test
public void entityProjections() {
    List<Product> products = sql().from(product).select(Projections.constructor(Product.class, product.name, product.description, product.price, product.amount)).fetch();
    assertEquals(30, products.size());
    for (Product p : products) {
        assertNotNull(p.getName());
        assertNotNull(p.getDescription());
        assertNotNull(p.getPrice());
        assertNotNull(p.getAmount());
    }
}
Also used : Product(com.querydsl.jdo.test.domain.Product) SProduct(com.querydsl.jdo.test.domain.sql.SProduct) Test(org.junit.Test)

Example 2 with Product

use of com.querydsl.jdo.test.domain.Product in project querydsl by querydsl.

the class OrderingTest method doPersist.

@BeforeClass
public static void doPersist() {
    List<Object> entities = Lists.newArrayList();
    for (int i = 0; i < 10; i++) {
        entities.add(new Product("C" + i, "F" + i, i * 200.00, 2));
        entities.add(new Product("B" + i, "E" + i, i * 200.00, 4));
        entities.add(new Product("A" + i, "D" + i, i * 200.00, 6));
    }
    doPersist(entities);
}
Also used : QProduct(com.querydsl.jdo.test.domain.QProduct) Product(com.querydsl.jdo.test.domain.Product) BeforeClass(org.junit.BeforeClass)

Example 3 with Product

use of com.querydsl.jdo.test.domain.Product in project querydsl by querydsl.

the class SubqueriesTest method doPersist.

@BeforeClass
public static void doPersist() {
    List<Object> entities = Lists.newArrayList();
    for (int i = 0; i < 10; i++) {
        entities.add(new Product("C" + i, "F" + i, i * 200.00, 2));
        entities.add(new Product("B" + i, "E" + i, i * 200.00, 4));
        entities.add(new Product("A" + i, "D" + i, i * 200.00, 6));
    }
    doPersist(entities);
}
Also used : QProduct(com.querydsl.jdo.test.domain.QProduct) Product(com.querydsl.jdo.test.domain.Product) BeforeClass(org.junit.BeforeClass)

Example 4 with Product

use of com.querydsl.jdo.test.domain.Product in project querydsl by querydsl.

the class JDOSQLQueryTest method doPersist.

@BeforeClass
public static void doPersist() {
    List<Object> entities = Lists.newArrayList();
    for (int i = 0; i < 10; i++) {
        entities.add(new Product("C" + i, "F", 200.00, 2));
        entities.add(new Product("B" + i, "E", 400.00, 4));
        entities.add(new Product("A" + i, "D", 600.00, 6));
    }
    doPersist(entities);
}
Also used : Product(com.querydsl.jdo.test.domain.Product) SProduct(com.querydsl.jdo.test.domain.sql.SProduct) BeforeClass(org.junit.BeforeClass)

Example 5 with Product

use of com.querydsl.jdo.test.domain.Product in project querydsl by querydsl.

the class FetchPlanTest method doPersist.

@BeforeClass
public static void doPersist() {
    List<Object> entities = Lists.newArrayList();
    for (int i = 0; i < 10; i++) {
        entities.add(new Product("C" + i, "F", 200.00, 2));
        entities.add(new Product("B" + i, "E", 400.00, 4));
        entities.add(new Product("A" + i, "D", 600.00, 6));
    }
    doPersist(entities);
}
Also used : QProduct(com.querydsl.jdo.test.domain.QProduct) Product(com.querydsl.jdo.test.domain.Product) BeforeClass(org.junit.BeforeClass)

Aggregations

Product (com.querydsl.jdo.test.domain.Product)11 QProduct (com.querydsl.jdo.test.domain.QProduct)9 BeforeClass (org.junit.BeforeClass)8 Test (org.junit.Test)3 SProduct (com.querydsl.jdo.test.domain.sql.SProduct)2 QStore (com.querydsl.jdo.test.domain.QStore)1 Store (com.querydsl.jdo.test.domain.Store)1