|
|
@ -7,6 +7,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|
|
|
|
* @author qi |
|
|
|
* Created by qi_liang on 2018/6/21. |
|
|
|
* Created by qi_liang on 2018/6/21. |
|
|
|
* 采用jdk8 默认方法,所以该实现类废弃 |
|
|
|
* 采用jdk8 默认方法,所以该实现类废弃 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -26,43 +27,43 @@ public abstract class BaseServiceImpl<T> implements BaseService<T>{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Long save(T entity) { |
|
|
|
public Long save(T entity) { |
|
|
|
return getBaseDao().save(entity); |
|
|
|
return getBaseDao().save(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(T entity) { |
|
|
|
public void update(T entity) { |
|
|
|
|
|
|
|
|
|
|
|
getBaseDao().update(entity); |
|
|
|
getBaseDao().update(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void delete(Long id) { |
|
|
|
public void delete(Long id) { |
|
|
|
|
|
|
|
|
|
|
|
getBaseDao().delete(id); |
|
|
|
getBaseDao().delete(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void batchSave(List<T> entitylist) { |
|
|
|
public void batchSave(List<T> entityList) { |
|
|
|
|
|
|
|
|
|
|
|
getBaseDao().batchSave(entitylist); |
|
|
|
getBaseDao().batchSave(entityList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void batchUpdate(List<T> entitylist) { |
|
|
|
public void batchUpdate(List<T> entityList) { |
|
|
|
|
|
|
|
|
|
|
|
getBaseDao().batchUpdate(entitylist); |
|
|
|
getBaseDao().batchUpdate(entityList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void batchDelete(List<T> entitylist) { |
|
|
|
public void batchDelete(List<T> entityList) { |
|
|
|
|
|
|
|
|
|
|
|
getBaseDao().batchDelete(entitylist); |
|
|
|
getBaseDao().batchDelete(entityList); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|