feat: 默认Repository的主键为Long
This commit is contained in:
@@ -101,5 +101,5 @@ import org.springframework.data.repository.query.QueryByExampleExecutor;
|
|||||||
* @author lanyuanxiaoyao
|
* @author lanyuanxiaoyao
|
||||||
*/
|
*/
|
||||||
@NoRepositoryBean
|
@NoRepositoryBean
|
||||||
public interface SimpleRepository<E, ID> extends FenixJpaRepository<E, ID>, FenixJpaSpecificationExecutor<E>, QueryByExampleExecutor<E>, QuerydslPredicateExecutor<E> {
|
public interface SimpleRepository<E> extends FenixJpaRepository<E, Long>, FenixJpaSpecificationExecutor<E>, QueryByExampleExecutor<E>, QuerydslPredicateExecutor<E> {
|
||||||
}
|
}
|
||||||
@@ -96,14 +96,14 @@ public abstract class SimpleServiceSupport<ENTITY extends SimpleEntity> implemen
|
|||||||
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
private static final Integer DEFAULT_PAGE_INDEX = 1;
|
private static final Integer DEFAULT_PAGE_INDEX = 1;
|
||||||
private static final Integer DEFAULT_PAGE_SIZE = 10;
|
private static final Integer DEFAULT_PAGE_SIZE = 10;
|
||||||
protected final SimpleRepository<ENTITY, Long> repository;
|
protected final SimpleRepository<ENTITY> repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造函数
|
* 构造函数
|
||||||
*
|
*
|
||||||
* @param repository 简单仓库实例
|
* @param repository 简单仓库实例
|
||||||
*/
|
*/
|
||||||
public SimpleServiceSupport(SimpleRepository<ENTITY, Long> repository) {
|
public SimpleServiceSupport(SimpleRepository<ENTITY> repository) {
|
||||||
this.repository = repository;
|
this.repository = repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ import com.lanyuanxiaoyao.service.template.entity.Company;
|
|||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface CompanyRepository extends SimpleRepository<Company, Long> {
|
public interface CompanyRepository extends SimpleRepository<Company> {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository;
|
|||||||
|
|
||||||
@SuppressWarnings("NullableProblems")
|
@SuppressWarnings("NullableProblems")
|
||||||
@Repository
|
@Repository
|
||||||
public interface EmployeeRepository extends SimpleRepository<Employee, Long> {
|
public interface EmployeeRepository extends SimpleRepository<Employee> {
|
||||||
@EntityGraph(value = "employee.detail", type = EntityGraph.EntityGraphType.FETCH)
|
@EntityGraph(value = "employee.detail", type = EntityGraph.EntityGraphType.FETCH)
|
||||||
@Override
|
@Override
|
||||||
Optional<Employee> findOne(Specification<Employee> specification);
|
Optional<Employee> findOne(Specification<Employee> specification);
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ import com.lanyuanxiaoyao.service.template.entity.Report;
|
|||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface ReportRepository extends SimpleRepository<Report, Long> {
|
public interface ReportRepository extends SimpleRepository<Report> {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user