@Override public void copyAppTagsToCommentTags() { List<Tag> appTags = loadAllApplicationTags(); if (appTags == null) { LOG.info("There is no tags in system."); return; } LOG.info("About to copy " + appTags.size() + " application tags to comment tags."); for (Tag appTag : appTags) { if (loadCommentTag(appTag.getName()) == null) { LOG.info("Copying " + appTag.getName()); Tag newCommentTag = new Tag(); newCommentTag.setName(appTag.getName()); newCommentTag.setEnterpriseTag(appTag.getEnterpriseTag()); newCommentTag.setDefaultJsonFilter(appTag.getDefaultJsonFilter()); newCommentTag.setType(TagType.COMMENT); tagDao.saveOrUpdate(newCommentTag); } appTag.setType(TagType.APPLICATION); tagDao.saveOrUpdate(appTag); } }