Examples of JpaTag


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

    @Transactional
    @Rollback(true)
    public void delete_valid_tagImpl(){
        String keyword = "misc";
        // make sure we do have a tag with the keyword in the db
        JpaTag control = (JpaTag)repository.getByKeyword(keyword);
        assertNotNull(control);
        // create a tag with the keyword not of JpaTag.class for branch coverage
        TagImpl tag = new TagImpl(keyword);
        assertNotNull(tag);
        repository.delete(tag);
View Full Code Here

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

        return manager.find(JpaTag.class, Long.parseLong(id));
    }

    @Override
    public Tag save(Tag item) {
        JpaTag tag = converter.convert(item);
        return saveOrUpdate(tag.getEntityId(), manager, tag);
    }
View Full Code Here

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

    public JpaTag convert(Tag source) {
        return source instanceof JpaTag ? (JpaTag)source : createEntity(source);
    }

    private JpaTag createEntity(Tag source) {
        JpaTag convertedTag;
        TypedQuery<JpaTag> query = manager.createNamedQuery(JpaTag.FIND_BY_KEYWORD, JpaTag.class);
        query.setParameter(JpaTag.KEYWORD_PARAM, source.getKeyword());
        convertedTag = JpaUtil.getSingleResult(query.getResultList());

        if (convertedTag == null){
            convertedTag = new JpaTag();
        }
        updateProperties(source, convertedTag);
        return convertedTag;
    }
View Full Code Here

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

        return manager.find(JpaTag.class, Long.parseLong(id));
    }

    @Override
    public Tag save(Tag item) {
        JpaTag tag = converter.convert(item);
        return saveOrUpdate(tag.getEntityId(), manager, tag);
    }
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.