Package org.apache.art

Examples of org.apache.art.Painting


        query.setParameters(Collections.singletonMap("id", null));

        List objects = context.performQuery(query);
        assertEquals(1, objects.size());

        Painting p = (Painting) objects.get(0);
        assertEquals(33003, DataObjectUtils.intPKForObject(p));
    }
View Full Code Here


        SelectQuery query = new SelectQuery(Painting.class);
        query.addPrefetch(Painting.TO_PAINTING_INFO_PROPERTY);
        List daos = ctxt.performQuery(query);
        assertTrue(!daos.isEmpty());
        for (Iterator it = daos.iterator(); it.hasNext();) {
            Painting p = (Painting) it.next();
            PaintingInfo pi = p.getToPaintingInfo();
            assertEquals("persistence state", PersistenceState.COMMITTED, p
                    .getPersistenceState());
            assertEquals("persistence state", PersistenceState.COMMITTED, pi
                    .getPersistenceState());
        }
    }
View Full Code Here

    @Override
    protected void populateTables() throws Exception {
        DataContext ctxt = createDataContext();
        for (int i = 0; i < 10; i++) {
            Painting p = ctxt.newObject(Painting.class);
            p.setPaintingTitle("Painting title #" + i);
            p.setPaintingDescription("Painting desc #" + i);
            PaintingInfo pi = ctxt.newObject(PaintingInfo.class);
            pi.setTextReview("Review #" + i);
            p.setToPaintingInfo(pi);
        }
        ctxt.commitChanges();
    }
View Full Code Here

        EJBQLQuery query = new EJBQLQuery(ejbql);

        List ps = createDataContext().performQuery(query);
        assertEquals(1, ps.size());

        Painting p = (Painting) ps.get(0);
        assertEquals("P1", p.getPaintingTitle());
        assertEquals(new BigDecimal(3000d), p.getEstimatedPrice(), 0.01);
    }
View Full Code Here

        EJBQLQuery query = new EJBQLQuery(ejbql);

        List ps = createDataContext().performQuery(query);
        assertEquals(1, ps.size());

        Painting p = (Painting) ps.get(0);
        assertEquals("P1", p.getPaintingTitle());
        assertEquals(new BigDecimal(3000d), p.getEstimatedPrice(), 0.01);
    }
View Full Code Here

        EJBQLQuery query = new EJBQLQuery(ejbql);

        List ps = createDataContext().performQuery(query);
        assertEquals(1, ps.size());

        Painting p = (Painting) ps.get(0);
        assertEquals("P2", p.getPaintingTitle());
        assertEquals(new BigDecimal(5000d), p.getEstimatedPrice(), 0.01);
    }
View Full Code Here

        EJBQLQuery query = new EJBQLQuery(ejbql);

        List ps = createDataContext().performQuery(query);
        assertEquals(1, ps.size());

        Painting p = (Painting) ps.get(0);
        assertEquals("P2", p.getPaintingTitle());
        assertEquals(new BigDecimal(5000d), p.getEstimatedPrice(), 0.01);
    }
View Full Code Here

        EJBQLQuery query = new EJBQLQuery(ejbql);

        List ps = createDataContext().performQuery(query);
        assertEquals(1, ps.size());

        Painting p = (Painting) ps.get(0);
        assertEquals("P1", p.getPaintingTitle());
        assertEquals(new BigDecimal(3000d), p.getEstimatedPrice(), 0.01);
    }
View Full Code Here

        query.setParameter("param", a);

        List ps = context.performQuery(query);
        assertEquals(1, ps.size());

        Painting p = (Painting) ps.get(0);
        assertEquals(33002, DataObjectUtils.intPKForObject(p));
    }
View Full Code Here

        EJBQLQuery query = new EJBQLQuery(ejbql);

        List ps = context.performQuery(query);
        assertEquals(1, ps.size());

        Painting p = (Painting) ps.get(0);
        assertEquals(33002, DataObjectUtils.intPKForObject(p));
    }
View Full Code Here

TOP

Related Classes of org.apache.art.Painting

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.