Package com.mysema.query.jdo.test.domain

Examples of com.mysema.query.jdo.test.domain.Product


        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for (int i = 0; i < 10; i++) {
                // Product instances
                pm.makePersistent(new Product("ABC" + i, "F" + i, i * 200.00, 2, publicationDate));
                pm.makePersistent(new Product("DEF" + i, "E" + i, i * 200.00, 4, publicationDate));
                pm.makePersistent(new Product("GHI" + i, "D" + i, i * 200.00, 6, publicationDate));

                // Product of Store
                Product product = new Product(productName,"A",100.0,1, publicationDate);
                pm.makePersistent(product);

                // Store instances
                Store store = new Store();
                store.getProducts().add(product);
View Full Code Here


    private final QStore otherStore = new QStore("otherStore");

    @Test
    public void StandardTest() {
        Product p = query().from(product).where(product.name.eq(productName)).limit(1).uniqueResult(product);
        Product p2 = query().from(product).where(product.name.startsWith(otherName)).limit(1).uniqueResult(product);
        standardTest.noProjections();
        standardTest.noCounts();

        standardTest.runBooleanTests(product.name.isNull(), otherProduct.price.lt(10.00));
        standardTest.runCollectionTests(store.products, otherStore.products, p, p2);
View Full Code Here

        PersistenceManager pm = pmf.getPersistenceManager();
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for (int i = 0; i < 10; i++) {
                pm.makePersistent(new Product("C" + i, "F", 200.00, 2));
                pm.makePersistent(new Product("B" + i, "E", 400.00, 4));
                pm.makePersistent(new Product("A" + i, "D", 600.00, 6));
            }
            tx.commit();
        } finally {
            if (tx.isActive()) {
                tx.rollback();
View Full Code Here

        PersistenceManager pm = pmf.getPersistenceManager();
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for (int i = 0; i < 10; i++) {
                pm.makePersistent(new Product("C" + i, "F" + i, i * 200.00, 2));
                pm.makePersistent(new Product("B" + i, "E" + i, i * 200.00, 4));
                pm.makePersistent(new Product("A" + i, "D" + i, i * 200.00, 6));
            }
            tx.commit();
        } finally {
            if (tx.isActive()) {
                tx.rollback();
View Full Code Here

        // Persistence of a Product and a Book.
        PersistenceManager pm = pmf.getPersistenceManager();
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            pm.makePersistent(new Product("Sony Discman","A standard discman from Sony", 200.00, 3));
            pm.makePersistent(new Book("Lord of the Rings by Tolkien","The classic story", 49.99, 5, "JRR Tolkien", "12345678","MyBooks Factory"));
            tx.commit();
        } finally {
            if (tx.isActive()) {
                tx.rollback();
View Full Code Here

        PersistenceManager pm = pmf.getPersistenceManager();
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for (int i = 0; i < 10; i++) {
                pm.makePersistent(new Product("C" + i, "F" + i, i * 200.00, 2));
                pm.makePersistent(new Product("B" + i, "E" + i, i * 200.00, 4));
                pm.makePersistent(new Product("A" + i, "D" + i, i * 200.00, 6));
            }
            tx.commit();
        } finally {
            if (tx.isActive()) {
                tx.rollback();
View Full Code Here

        PersistenceManager pm = pmf.getPersistenceManager();
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for (int i = 0; i < 10; i++) {
                pm.makePersistent(new Product("C" + i, "F", 200.00, 2));
                pm.makePersistent(new Product("B" + i, "E", 400.00, 4));
                pm.makePersistent(new Product("A" + i, "D", 600.00, 6));
            }
            tx.commit();
        } finally {
            if (tx.isActive()) {
                tx.rollback();
View Full Code Here

    private QStore store = QStore.store;

    @Test
    public void test() {
        Product p = query().from(product).limit(1).uniqueResult(product);
        for (BooleanExpression f : getFilters(
                product.name, product.description, "A0",
                store.products, p,
                store.productsByName, "A0", p,
                product.amount)) {
View Full Code Here

        PersistenceManager pm = pmf.getPersistenceManager();
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for (int i = 0; i < 10; i++) {
                pm.makePersistent(new Product("C" + i, "F" + i, i * 200.00, 2));
                pm.makePersistent(new Product("B" + i, "E" + i, i * 200.00, 4));
                pm.makePersistent(new Product("A" + i, "D" + i, i * 200.00, 6));
            }
            tx.commit();
        } finally {
            if (tx.isActive()) {
                tx.rollback();
View Full Code Here

        query(store, store.productsByName.containsKey("XXX"));
    }
   
    @Test
    public void Contains_Value() {
        Product product = query().from(QProduct.product).list(QProduct.product).get(0);
        query(store, store.productsByName.containsValue(product));
    }
View Full Code Here

TOP

Related Classes of com.mysema.query.jdo.test.domain.Product

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.