Package com.impetus.client.crud.datatypes.entities

Examples of com.impetus.client.crud.datatypes.entities.Collecte


    @Test
    public void testInsert()
    {
        // une collecte
        Collecte c = new Collecte();
        c.setId("0001");
        c.setEAN("3251248033108");
        c.setIdProduit(123342124L);
        c.setDateStatut(new Date());
        c.setStatut(0);
        // qq photos
        List<Photoo> photos = new ArrayList<Photoo>();
        Photoo p1 = new Photoo();
        p1.setNomPhoto("Photo de Face");
        p1.setMd5("1235847EA873");
        p1.setNomFichier("photo1.jpg");
        photos.add(p1);
        Photoo p2 = new Photoo();
        p2.setNomPhoto("Photo composition");
        p2.setMd5("234847EA873");
        p2.setNomFichier("photo2.jpg");
        photos.add(p2);
        Photoo p3 = new Photoo();
        p3.setNomPhoto("Photo prix");
        p3.setMd5("5164847EA873");
        p3.setNomFichier("photo3.jpg");
        photos.add(p3);

        c.setPhotos(photos);
        em.persist(c);
        testSelect();

    }
View Full Code Here


   
    @Test
    public void testNullEmbeddableInsert()
    {
        // une collecte
        Collecte c = new Collecte();
        c.setId("0001");
        c.setEAN("3251248033108");
        c.setIdProduit(123342124L);
        c.setDateStatut(new Date());
        c.setStatut(0);
              
        em.persist(c);
        testNullEmbeddable();

    }
View Full Code Here

    private void testSelect()
    {
        Query q = em.createQuery("select c from Collecte c where c.id =:id");
        q.setParameter("id", "0001");
        List<Collecte> collectes = q.getResultList();
        Collecte c = collectes.get(0);
        Assert.assertEquals(c.getEAN(), "3251248033108");
        Assert.assertEquals(c.getPhotos().size(), 3);
        Assert.assertEquals(c.getPhotos().iterator().next().getMd5(), "1235847EA873");
    }
View Full Code Here

    private void testNullEmbeddable()
    {
        Query q = em.createQuery("select c from Collecte c where c.id =:id");
        q.setParameter("id", "0001");
        List<Collecte> collectes = q.getResultList();
        Collecte c = collectes.get(0);
        Assert.assertEquals(c.getEAN(), "3251248033108");
        Assert.assertNull(c.getPhotos());
       
    }
View Full Code Here

TOP

Related Classes of com.impetus.client.crud.datatypes.entities.Collecte

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.