use of com.zyd.blog.persistence.beans.BizArticleTags in project OneBlog by zhangyd-c.
the class BizArticleTagsServiceImpl method insertList.
/**
* 批量插入,支持批量插入的数据库可以使用,例如MySQL,H2等,另外该接口限制实体包含id属性并且必须为自增列
*
* @param entities
*/
@Override
public void insertList(List<ArticleTags> entities) {
Assert.notNull(entities, "ArticleTagss不可为空!");
List<BizArticleTags> list = new ArrayList<>();
for (ArticleTags entity : entities) {
entity.setUpdateTime(new Date());
entity.setCreateTime(new Date());
list.add(entity.getBizArticleTags());
}
bizArticleTagsMapper.insertList(list);
}
use of com.zyd.blog.persistence.beans.BizArticleTags in project OneBlog by zhangyd-c.
the class BizTagsServiceImpl method removeByPrimaryKey.
@Override
@Transactional(rollbackFor = Exception.class)
@RedisCache(flush = true)
public boolean removeByPrimaryKey(Long primaryKey) {
BizArticleTags articleTag = new BizArticleTags();
articleTag.setTagId(primaryKey);
List<BizArticleTags> articleTags = bizArticleTagsMapper.select(articleTag);
if (!CollectionUtils.isEmpty(articleTags)) {
throw new ZhydException("当前标签下存在文章信息,禁止删除!");
}
return bizTagsMapper.deleteByPrimaryKey(primaryKey) > 0;
}
Aggregations