Package com.jeecms.cms.manager.assist.impl

Source Code of com.jeecms.cms.manager.assist.impl.CmsCommentExtMngImpl

package com.jeecms.cms.manager.assist.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeecms.cms.dao.assist.CmsCommentExtDao;
import com.jeecms.cms.entity.assist.CmsComment;
import com.jeecms.cms.entity.assist.CmsCommentExt;
import com.jeecms.cms.manager.assist.CmsCommentExtMng;
import com.jeecms.common.hibernate3.Updater;

@Service
@Transactional
public class CmsCommentExtMngImpl implements CmsCommentExtMng {
  public CmsCommentExt save(String ip, String text, CmsComment comment) {
    CmsCommentExt ext = new CmsCommentExt();
    ext.setText(text);
    ext.setIp(ip);
    ext.setComment(comment);
    comment.setCommentExt(ext);
    dao.save(ext);
    return ext;
  }

  public CmsCommentExt update(CmsCommentExt bean) {
    Updater<CmsCommentExt> updater = new Updater<CmsCommentExt>(bean);
    bean = dao.updateByUpdater(updater);
    return bean;
  }

  public int deleteByContentId(Integer contentId) {
    return dao.deleteByContentId(contentId);
  }

  private CmsCommentExtDao dao;

  @Autowired
  public void setDao(CmsCommentExtDao dao) {
    this.dao = dao;
  }
}
TOP

Related Classes of com.jeecms.cms.manager.assist.impl.CmsCommentExtMngImpl

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.