package cn.com.poc.long_document.service.impl;

import cn.com.poc.long_document.model.BizLongTextExampleModel;
import cn.com.poc.long_document.repository.BizLongTextExampleRepository;
import cn.com.poc.long_document.service.BizLongTextExampleService;
import cn.com.yict.framemax.core.service.impl.BaseServiceImpl;
import cn.com.yict.framemax.data.model.PagingInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;

@Service
public class BizLongTextExampleServiceImpl extends BaseServiceImpl
 			 implements BizLongTextExampleService {
   
   @Resource
   private BizLongTextExampleRepository repository;
    			 
   public BizLongTextExampleModel get(Integer id) throws Exception{
       return this.repository.get(id);
   }
    
   public Collection<BizLongTextExampleModel> findByExample(BizLongTextExampleModel example,PagingInfo pagingInfo) throws Exception{
       if(example == null){
           example = new BizLongTextExampleModel();
       }
       return this.repository.findByExample(example,pagingInfo);
   }
    
   public void delete(BizLongTextExampleModel model) throws Exception{
       this.repository.remove(model);
   }
    
   public void deleteById(Integer id) throws Exception{
       this.repository.removeByPk(id);
   }
   
   public void deleteAll(Collection<Integer> ids) throws Exception{
   	   this.repository.removeAllByPk(ids);
   }
    
   public BizLongTextExampleModel save(BizLongTextExampleModel model) throws Exception{
       return this.repository.save(model);
   }
    
   public Collection<BizLongTextExampleModel> saveAll(Collection<BizLongTextExampleModel> models) throws Exception{
       return this.repository.saveAll(models);
   }    	
}