Updated and fixed in pagination service impl

This commit is contained in:
Sambo Chea 2020-07-03 15:01:02 +07:00
parent 950f2efaaf
commit 9275a814b4
2 changed files with 11 additions and 1 deletions

View File

@ -1,9 +1,11 @@
package com.cubetiqs.data.service;
import com.cubetiqs.data.domain.BaseEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import java.io.Serializable;
import java.util.List;
/**
@ -16,7 +18,9 @@ import java.util.List;
* @since 1.0
*/
@NoServiceBean
public class PagingCrudServiceImpl<T, ID> extends AbstractCrudServiceImpl<T, ID> implements PagingCrudService<T, ID> {
public abstract class AbstractPagingCrudServiceImpl<T extends BaseEntity<ID>, ID extends Serializable>
extends AbstractCrudServiceImpl<T, ID>
implements PagingCrudService<T, ID> {
@Override
public Page<T> findAll(Pageable pageable) {
return getRepository().findAll(pageable);

View File

@ -65,5 +65,11 @@ public interface CrudService<T, ID> extends BaseService<T, ID> {
*/
void deleteAll(List<ID> ids);
/**
* Check entity exists within ID
*
* @param id ID
* @return boolean
*/
boolean existsById(ID id);
}