Package com.jeecms.cms.manager.main.impl

Source Code of com.jeecms.cms.manager.main.impl.ChannelExtMngImpl

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

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

import com.jeecms.cms.dao.main.ChannelExtDao;
import com.jeecms.cms.entity.main.Channel;
import com.jeecms.cms.entity.main.ChannelExt;
import com.jeecms.cms.manager.main.ChannelExtMng;
import com.jeecms.common.hibernate3.Updater;

@Service
@Transactional
public class ChannelExtMngImpl implements ChannelExtMng {
  public ChannelExt save(ChannelExt ext, Channel channel) {
    channel.setChannelExt(ext);
    ext.setChannel(channel);
    ext.init();
    dao.save(ext);
    return ext;
  }

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

  private ChannelExtDao dao;

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

Related Classes of com.jeecms.cms.manager.main.impl.ChannelExtMngImpl

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.