Skip to content

paging doesn't work with DynamicProxy - gives NoSuchMethodError if args to exactly match. #1818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mikereiche opened this issue Sep 11, 2023 · 0 comments · Fixed by #1819
Closed

Comments

@mikereiche
Copy link
Collaborator

paging doesn't work with DynamicProxy - gives NoSuchMethodError
the parameters in the method definition and the arguments must have the exact same type (i.e. Collection color and LinkedListiatas apparently do not work. I don't know why this only seems to be an issue here.

public interface AirportRepository extends CouchbaseRepository<Airport, String>, DynamicProxyable<AirportRepository> {

	@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
	List<Airport> findByIataInAndIcaoIn(java.util.LinkedList<String> size, java.util.LinkedList<String> color,
			PageRequest pageable);
CouchbaseRepositoryQueryIntegrationTests
@Test
	void issue1304CollectionParameter() {
		Airport vie = null;
		try {
			vie = new Airport("airports::vie", "vie", "low5");
			airportRepository.withScope("_default").save(vie);
			java.util.LinkedList<String> iatas = new LinkedList<String>();
			iatas.add(vie.getIata());
			java.util.LinkedList<String> icaos = new LinkedList<String>();
			icaos.add(vie.getIcao());
			icaos.add("blue");
			PageRequest pageable = PageRequest.of(0, 1, Sort.by("iata"));
			List<Airport> airports = airportRepository.findByIataInAndIcaoIn(iatas, icaos, pageable);
mikereiche added a commit that referenced this issue Sep 12, 2023
Allow non-exact (isAssignableFrom) argument matching for methods
called by DyanmicProxyable. If there are exactly two candidates,
and one returns an Iterable and the other returns a List, use
the method that returns the List.  This is due to
CouchbaseRepository defining findAll() methods as List<?>, while
PagingAndSortyRepository defines findAll() to return an Iterable.
This needs to be addressed separately.

Closes #1818.
mikereiche added a commit that referenced this issue Sep 12, 2023
Allow non-exact (isAssignableFrom) argument matching for methods
called by DyanmicProxyable. If there are exactly two candidates,
and one returns an Iterable and the other returns a List, use
the method that returns the List.  This is due to
CouchbaseRepository defining findAll() methods as List<?>, while
PagingAndSortyRepository defines findAll() to return an Iterable.
This needs to be addressed separately.

Closes #1818.
mikereiche added a commit that referenced this issue Sep 12, 2023
Allow non-exact (isAssignableFrom) argument matching for methods
called by DyanmicProxyable. If there are exactly two candidates,
and one returns an Iterable and the other returns a List, use
the method that returns the List.  This is due to
CouchbaseRepository defining findAll() methods as List<?>, while
PagingAndSortyRepository defines findAll() to return an Iterable.
This needs to be addressed separately.

Closes #1818.
mikereiche added a commit that referenced this issue Sep 14, 2023
Allow non-exact (isAssignableFrom) argument matching for methods
called by DyanmicProxyable. If there are exactly two candidates,
and one returns an Iterable and the other returns a List, use
the method that returns the List.  This is due to
CouchbaseRepository defining findAll() methods as List<?>, while
PagingAndSortyRepository defines findAll() to return an Iterable.
This needs to be addressed separately.

Closes #1818.
mikereiche added a commit that referenced this issue Sep 14, 2023
Allow non-exact (isAssignableFrom) argument matching for methods
called by DyanmicProxyable. If there are exactly two candidates,
and one returns an Iterable and the other returns a List, use
the method that returns the List.  This is due to
CouchbaseRepository defining findAll() methods as List<?>, while
PagingAndSortyRepository defines findAll() to return an Iterable.
This needs to be addressed separately.

Closes #1818.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant