Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aureamunoz committed May 30, 2024
1 parent 657f873 commit 7a90347
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ public boolean isListCrudRepository(String repositoryName) {
|| isRepositoryInstanceOf(JPA_REPOSITORY_INTERFACE, repositoryName);
}

public boolean isJpaRepository(String repositoryName) {
return isRepositoryInstanceOf(JPA_REPOSITORY_INTERFACE, repositoryName);
}

public boolean isPagingAndSortingRepository(String repositoryName) {
return isRepositoryInstanceOf(PAGING_AND_SORTING_REPOSITORY_INTERFACE, repositoryName)
|| isRepositoryInstanceOf(LIST_PAGING_AND_SORTING_REPOSITORY_INTERFACE, repositoryName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,9 @@ void registerRepositories(CombinedIndexBuildItem indexBuildItem, Capabilities ca
PAGING_AND_SORTING_REPOSITORY_INTERFACE, LIST_PAGING_AND_SORTING_REPOSITORY_INTERFACE,
JPA_REPOSITORY_INTERFACE);

boolean paged = false;
if (entityClassHelper.containsPagedRepository(repositoriesToImplement)) {
paged = true;
}
implementResources(capabilities, implementationsProducer, restDataResourceProducer, resourcePropertiesProducer,
unremovableBeansProducer, new RepositoryMethodsImplementor(index, entityClassHelper),
new RepositoryPropertiesProvider(index, paged),
index,
repositoriesToImplement);
}

Expand All @@ -114,11 +110,18 @@ private void implementResources(Capabilities capabilities,
BuildProducer<ResourcePropertiesBuildItem> resourcePropertiesProducer,
BuildProducer<UnremovableBeanBuildItem> unremovableBeansProducer,
ResourceMethodsImplementor methodsImplementor,
ResourcePropertiesProvider propertiesProvider,
IndexView index,
// ResourcePropertiesProvider propertiesProvider,
List<ClassInfo> repositoriesToImplement) {
ClassOutput classOutput = new GeneratedBeanGizmoAdaptor(implementationsProducer);
ResourceImplementor resourceImplementor = new ResourceImplementor(methodsImplementor);
EntityClassHelper entityClassHelper = new EntityClassHelper(index);
for (ClassInfo classInfo : repositoriesToImplement) {
boolean paged = false;
if (entityClassHelper.isPagingAndSortingRepository(classInfo.name().toString())) {
paged = true;
}
ResourcePropertiesProvider propertiesProvider = new RepositoryPropertiesProvider(index, paged);
List<Type> generics = getGenericTypes(classInfo);
String repositoryName = classInfo.name().toString();
String entityType = generics.get(0).toString();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkus.it.spring.data.rest;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface BooksRepository extends PagingAndSortingRepository<Book, Long> {
public interface BooksRepository extends PagingAndSortingRepository<Book, Long>, CrudRepository<Book, Long> {
}

0 comments on commit 7a90347

Please sign in to comment.