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

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


        // 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", 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", 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

                "Sony MP3 player").not()));
    }

    @Test
    public void CollectionTests() {
        Product product = new Product();
        // collection
        assertEquals("store.products.contains(a1)",
                serialize(store.products.contains(product)));
//        assertEquals("store.products.get(0) == a1",
//                serialize(store.products.get(0).eq(product)));
View Full Code Here

    @Test
    public void MapTests() {
        assertEquals("store.productsByName.containsKey(a1)",
                serialize(store.productsByName.containsKey("")));
        assertEquals("store.productsByName.containsValue(a1)",
                serialize(store.productsByName.containsValue(new Product())));

        assertEquals("store.productsByName.isEmpty()",
                serialize(store.productsByName.isEmpty()));
        assertEquals("!store.productsByName.isEmpty()",
                serialize(store.productsByName.isNotEmpty()));
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.