All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.haoxuer.discover.user.data.service.impl.UserVerificationServiceImpl Maven / Gradle / Ivy

There is a newer version: 3.3.18-20230117
Show newest version
package com.haoxuer.discover.user.data.service.impl;

import com.haoxuer.discover.data.core.Updater;
import com.haoxuer.discover.data.page.Filter;
import com.haoxuer.discover.data.page.Order;
import com.haoxuer.discover.data.page.Page;
import com.haoxuer.discover.data.page.Pageable;
import com.haoxuer.discover.data.utils.FilterUtils;
import com.haoxuer.discover.user.data.dao.UserVerificationDao;
import com.haoxuer.discover.user.data.entity.UserVerification;
import com.haoxuer.discover.user.data.service.UserVerificationService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * Created by imake on 2017年07月20日16:37:49.
 */
@Service
@Transactional
public class UserVerificationServiceImpl implements UserVerificationService {
  
  private UserVerificationDao dao;
  
  
  @Override
  @Transactional(readOnly = true)
  public UserVerification findById(Long id) {
    return dao.findById(id);
  }
  
  
  @Override
  @Transactional
  public UserVerification save(UserVerification bean) {
    dao.save(bean);
    return bean;
  }
  
  @Override
  @Transactional
  public UserVerification update(UserVerification bean) {
    Updater updater = new Updater(bean);
    return dao.updateByUpdater(updater);
  }
  
  @Override
  @Transactional
  public UserVerification deleteById(Long id) {
    UserVerification bean = dao.findById(id);
    dao.deleteById(id);
    return bean;
  }
  
  @Override
  @Transactional
  public UserVerification[] deleteByIds(Long[] ids) {
    UserVerification[] beans = new UserVerification[ids.length];
    for (int i = 0, len = ids.length; i < len; i++) {
      beans[i] = deleteById(ids[i]);
    }
    return beans;
  }
  
  
  @Autowired
  public void setDao(UserVerificationDao dao) {
    this.dao = dao;
  }
  
  @Override
  public Page page(Pageable pageable) {
    return dao.page(pageable);
  }
  
  
  @Override
  public Page page(Pageable pageable, Object search) {
    List filters = FilterUtils.getFilters(search);
    if (filters != null) {
      pageable.getFilters().addAll(filters);
    }
    return dao.page(pageable);
  }
  
  @Override
  public List list(int first, Integer size, List filters, List orders) {
    return dao.list(first, size, filters, orders);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy