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

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

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.CmsGuestbookExtDao;
import com.jeecms.cms.entity.assist.CmsGuestbook;
import com.jeecms.cms.entity.assist.CmsGuestbookExt;
import com.jeecms.cms.manager.assist.CmsGuestbookExtMng;
import com.jeecms.common.hibernate3.Updater;

@Service
@Transactional
public class CmsGuestbookExtMngImpl implements CmsGuestbookExtMng {
  public CmsGuestbookExt save(CmsGuestbookExt ext, CmsGuestbook guestbook) {
    guestbook.setExt(ext);
    ext.setGuestbook(guestbook);
    ext.init();
    dao.save(ext);
    return ext;
  }

  public CmsGuestbookExt update(CmsGuestbookExt ext) {
    Updater<CmsGuestbookExt> updater = new Updater<CmsGuestbookExt>(ext);
    CmsGuestbookExt entity = dao.updateByUpdater(updater);
    entity.blankToNull();
    return entity;
  }

  private CmsGuestbookExtDao dao;

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

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

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.