Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.JpaRegion


    }

    @Test
    @Rollback(true)
    public void save_existingEntity() {
        JpaRegion region = new JpaRegion();
        region.setEntityId(1L);
        region.setRegionWidgets(new ArrayList<RegionWidget>());
        JpaRegion saved = (JpaRegion)repository.save(region);
        manager.flush();
        assertThat(saved, is(not(sameInstance(region))));
        assertThat(saved.getEntityId(), is(equalTo(region.getEntityId())));
    }
View Full Code Here


    }

    @Test
    @Rollback(true)
    public void save_cascadePersist() {
        JpaRegion region = new JpaRegion();
        region.setRegionWidgets(new ArrayList<RegionWidget>());
        RegionWidget regionWidget = new JpaRegionWidget();
        region.getRegionWidgets().add(regionWidget);

        JpaRegion saved = (JpaRegion)repository.save(region);
        manager.flush();

        assertThat(saved.getRegionWidgets().size(), is(equalTo(1)));
        RegionWidget actual = saved.getRegionWidgets().get(0);

        assertThat(actual, is(sameInstance(regionWidget)));
        assertThat(actual.getId(), is(notNullValue()));
    }
View Full Code Here

    @Test
    @Rollback(true)
    public void save_cascadeMerge() {

        JpaRegion region = new JpaRegion(1L);
        region.setEntityId(1L);
        region.setRegionWidgets(new ArrayList<RegionWidget>());
        RegionWidget regionWidget = new JpaRegionWidget(1L);
        region.getRegionWidgets().add(regionWidget);

        System.out.println(region.toString());

        Region saved = repository.save(region);
        manager.flush();

        System.out.println(saved.toString());
View Full Code Here

    }

    @Test
    @Rollback(true)
    public void save_cascadeOrphan() {
        JpaRegion region = (JpaRegion)repository.get("1");
        String id = region.getRegionWidgets().get(0).getId();
        region.getRegionWidgets().remove(0);

        Region saved = repository.save(region);
        manager.flush();
        RegionWidget widget = manager.find(JpaRegionWidget.class, Long.parseLong(id));
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.JpaRegion

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.