Search in sources :

Example 6 with Product

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

the class GroupByTest 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)

Example 7 with Product

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

the class JDOQLMethodsTest 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 8 with Product

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

the class JDOQueryStandardTest method standardTest.

@Test
public void standardTest() {
    Product p = query().from(product).where(product.name.eq(productName)).limit(1).select(product).fetchOne();
    Product p2 = query().from(product).where(product.name.startsWith(otherName)).limit(1).select(product).fetchOne();
    standardTest.noProjections();
    standardTest.noCounts();
    standardTest.runBooleanTests(product.name.isNull(), otherProduct.price.lt(10.00));
    standardTest.runCollectionTests(store.products, otherStore.products, p, p2);
    standardTest.runDateTests(product.dateField, otherProduct.dateField, date);
    standardTest.runDateTimeTests(product.publicationDate, otherProduct.publicationDate, publicationDate);
    // NO list support in JDOQL
    //        testData.listTests(store.products, otherStore.products, p);
    standardTest.runMapTests(store.productsByName, otherStore.productsByName, productName, p, "X", p2);
    standardTest.runNumericCasts(product.price, otherProduct.price, 200.0);
    standardTest.runNumericTests(product.amount, otherProduct.amount, 2);
    standardTest.runStringTests(product.name, otherProduct.name, productName);
    standardTest.runTimeTests(product.timeField, otherProduct.timeField, time);
    standardTest.report();
}
Also used : QProduct(com.querydsl.jdo.test.domain.QProduct) Product(com.querydsl.jdo.test.domain.Product) Test(org.junit.Test)

Example 9 with Product

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

the class JDOQueryStandardTest method doPersist.

@BeforeClass
public static void doPersist() {
    List<Object> entities = Lists.newArrayList();
    for (int i = 0; i < 10; i++) {
        // Product instances
        entities.add(new Product("ABC" + i, "F" + i, i * 200.00, 2, publicationDate));
        entities.add(new Product("DEF" + i, "E" + i, i * 200.00, 4, publicationDate));
        entities.add(new Product("GHI" + i, "D" + i, i * 200.00, 6, publicationDate));
        // Product of Store
        Product product = new Product(productName, "A", 100.0, 1, publicationDate);
        entities.add(product);
        // Store instances
        Store store = new Store();
        store.getProducts().add(product);
        store.getProductsByName().put(productName, product);
        entities.add(store);
    }
    doPersist(entities);
}
Also used : QProduct(com.querydsl.jdo.test.domain.QProduct) Product(com.querydsl.jdo.test.domain.Product) QStore(com.querydsl.jdo.test.domain.QStore) Store(com.querydsl.jdo.test.domain.Store) BeforeClass(org.junit.BeforeClass)

Example 10 with Product

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

the class AggregateTest method doPersist.

@BeforeClass
public static void doPersist() {
    List<Product> 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