1
0

feat: 默认Repository的主键为Long

This commit is contained in:
2025-08-24 10:43:31 +08:00
parent 79b1632bc3
commit 9d52da9b1a
5 changed files with 6 additions and 6 deletions

View File

@@ -101,5 +101,5 @@ import org.springframework.data.repository.query.QueryByExampleExecutor;
* @author lanyuanxiaoyao
*/
@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> {
}

View File

@@ -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 Integer DEFAULT_PAGE_INDEX = 1;
private static final Integer DEFAULT_PAGE_SIZE = 10;
protected final SimpleRepository<ENTITY, Long> repository;
protected final SimpleRepository<ENTITY> repository;
/**
* 构造函数
*
* @param repository 简单仓库实例
*/
public SimpleServiceSupport(SimpleRepository<ENTITY, Long> repository) {
public SimpleServiceSupport(SimpleRepository<ENTITY> repository) {
this.repository = repository;
}

View File

@@ -4,5 +4,5 @@ import com.lanyuanxiaoyao.service.template.entity.Company;
import org.springframework.stereotype.Repository;
@Repository
public interface CompanyRepository extends SimpleRepository<Company, Long> {
public interface CompanyRepository extends SimpleRepository<Company> {
}

View File

@@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository;
@SuppressWarnings("NullableProblems")
@Repository
public interface EmployeeRepository extends SimpleRepository<Employee, Long> {
public interface EmployeeRepository extends SimpleRepository<Employee> {
@EntityGraph(value = "employee.detail", type = EntityGraph.EntityGraphType.FETCH)
@Override
Optional<Employee> findOne(Specification<Employee> specification);

View File

@@ -4,5 +4,5 @@ import com.lanyuanxiaoyao.service.template.entity.Report;
import org.springframework.stereotype.Repository;
@Repository
public interface ReportRepository extends SimpleRepository<Report, Long> {
public interface ReportRepository extends SimpleRepository<Report> {
}