com.quhaodian.user.data.service.impl.UserLoginLogServiceImpl Maven / Gradle / Ivy
package com.quhaodian.user.data.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.quhaodian.data.core.Updater;
import com.quhaodian.user.data.dao.UserLoginLogDao;
import com.quhaodian.user.data.entity.UserLoginLog;
import com.quhaodian.user.data.service.UserLoginLogService;
import com.quhaodian.data.page.Filter;
import com.quhaodian.data.page.Order;
import com.quhaodian.data.page.Page;
import com.quhaodian.data.page.Pageable;
import java.util.List;
import com.quhaodian.data.utils.FilterUtils;
/**
* Created by imake on 2017年07月21日15:55:37.
*/
@Service
@Transactional
public class UserLoginLogServiceImpl implements UserLoginLogService {
private UserLoginLogDao dao;
@Override
@Transactional(readOnly = true)
public UserLoginLog findById(Long id) {
return dao.findById(id);
}
@Override
@Transactional
public UserLoginLog save(UserLoginLog bean) {
dao.save(bean);
return bean;
}
@Override
@Transactional
public UserLoginLog update(UserLoginLog bean) {
Updater updater = new Updater(bean);
return dao.updateByUpdater(updater);
}
@Override
@Transactional
public UserLoginLog deleteById(Long id) {
UserLoginLog bean = dao.findById(id);
dao.deleteById(id);
return bean;
}
@Override
@Transactional
public UserLoginLog[] deleteByIds(Long[] ids) {
UserLoginLog[] beans = new UserLoginLog[ids.length];
for (int i = 0,len = ids.length; i < len; i++) {
beans[i] = deleteById(ids[i]);
}
return beans;
}
@Autowired
public void setDao(UserLoginLogDao 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);}
}