Package com.google.code.lightssh.project.scheduler.service

Source Code of com.google.code.lightssh.project.scheduler.service.SchedulerTypeManagerImpl

package com.google.code.lightssh.project.scheduler.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.google.code.lightssh.common.service.BaseManagerImpl;
import com.google.code.lightssh.project.scheduler.dao.SchedulerTypeDao;
import com.google.code.lightssh.project.scheduler.entity.SchedulerType;

/**
*
* @author YangXiaojin
*
*/
@Component("schedulerTypeManager")
public class SchedulerTypeManagerImpl extends BaseManagerImpl<SchedulerType> implements SchedulerTypeManager{

  private static final long serialVersionUID = 3512177844901314400L;
 
  @Resource(name="schedulerTypeDao")
  public void setDao(SchedulerTypeDao dao ){
    this.dao = dao;
  }
 
  public SchedulerTypeDao getDao( ){
    return (SchedulerTypeDao)this.dao;
  }
 
  /**
   * 安全取类型
   */
  public SchedulerType safeGet(String id,String name){
    return safeGet(id,name,null);
  }

  @Override
  public SchedulerType safeGet(String id, String name, String description) {
    SchedulerType type = dao.read(id);
    if( type == null ){
      type = new SchedulerType(id,name);
      type.setDescription(description);
      dao.create(type);
    }
   
    return type;
  }

}
TOP

Related Classes of com.google.code.lightssh.project.scheduler.service.SchedulerTypeManagerImpl

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.