Examples of JpaWidgetRating


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

    }

    @Test
    public void testNoConversion() {
        JpaWidgetRating template = new JpaWidgetRating();
        assertThat(converter.convert(template, "1"), is(sameInstance(template)));
    }
View Full Code Here

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

    public void convertValid() {
        WidgetRating template = new WidgetRatingImpl("1");
        template.setScore(1);
        template.setUserId("42");
       
        JpaWidgetRating jpaTemplate = converter.convert(template, "24");

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaWidgetRating.class)));
        assertThat(jpaTemplate.getScore(), is(equalTo(template.getScore())));
        assertThat(jpaTemplate.getUserId(), is(equalTo(template.getUserId())));
    }
View Full Code Here

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

    public JpaWidgetRating convert(WidgetRating source, String widgetId) {
        return source instanceof JpaWidgetRating ? (JpaWidgetRating) source : createEntity(source, widgetId);
    }

    private JpaWidgetRating createEntity(WidgetRating source, String widgetId) {
        JpaWidgetRating converted = null;
        if(source != null) {
            converted = new JpaWidgetRating();
            updateProperties(source, converted, widgetId);
        }
        return converted;
    }
View Full Code Here

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

        return manager.find(JpaWidgetRating.class, Long.parseLong(widgetRatingId));
    }

    @Override
    public WidgetRating createWidgetRating(String widgetId, WidgetRating rating) {
        JpaWidgetRating jpaItem = ratingConverter.convert(rating, widgetId);
        return saveOrUpdate(jpaItem.getEntityId(), manager, jpaItem);
    }
View Full Code Here

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

        return saveOrUpdate(jpaItem.getEntityId(), manager, jpaItem);
    }

    @Override
    public WidgetRating updateWidgetRating(String widgetId, WidgetRating rating) {
        JpaWidgetRating jpaItem = ratingConverter.convert(rating, widgetId);
        return saveOrUpdate(jpaItem.getEntityId(), manager, jpaItem);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.