Skip to content
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

ClassCastException for scrolling queries #1531

Closed
sergey-morenets opened this issue Jun 12, 2023 · 9 comments
Closed

ClassCastException for scrolling queries #1531

sergey-morenets opened this issue Jun 12, 2023 · 9 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@sergey-morenets
Copy link

Hi

We tried to use Scrolling API:

public interface OrderRepository 
	extends CrudRepository<Order, UUID> {
	
	Window<Order> findBy(ScrollPosition position);
}

However we received an exception when we invoked findBy() method:

Window<Order> window = orderRepository.findBy(ScrollPosition.offset());

Exception in thread "main" java.lang.ClassCastException: class demo.Order cannot be cast to class org.springframework.data.domain.Window (demo.Order and org.springframework.data.domain.Window are in unnamed module of loader 'app')
	at jdk.proxy2/jdk.proxy2.$Proxy89.findBy(Unknown Source)
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 12, 2023
@schauder
Copy link
Contributor

Keyset pagination is not yet supported for Spring Data Relational.

@schauder schauder closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
@schauder schauder added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 12, 2023
@sergey-morenets
Copy link
Author

Hi @schauder

Did you read carefully the ticket description? I didn't use pagination or keyset pagination. I used offset scrolling:

Window<Order> window = orderRepository.findBy(ScrollPosition.offset());

@schauder
Copy link
Contributor

Window and ScrollPosition are part of the new Key Set pagination. Use Slice, Page and Pageable and you should be fine.

Readers of this issue might be interested in #1299

@ElTav
Copy link

ElTav commented Jul 14, 2023

@schauder Do you know when you folks plan to add support for Window/ScrollPosition? The infra you mentioned in #1299 was aded in spring-projects/spring-data-commons#2151 a few months back

@schauder
Copy link
Contributor

Sorry, we don't have any specifics on those plans yet.

@ElTav
Copy link

ElTav commented Jul 17, 2023

Got it, what about Limit support from the 2023.M1 announcement?

@ElTav
Copy link

ElTav commented Jul 17, 2023

And is there an issue I can track for the rollout? Happy to create one otherwise

@schauder
Copy link
Contributor

#1299

@ElTav
Copy link

ElTav commented Jul 17, 2023

Got it, will Limit be incorporated into the same release/any chance that could be incorporated sooner? Would fulfill the same requirement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants