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

Non-native NullHandling not supported by JpaRepository #3729

Closed
demonfiddler opened this issue Jan 4, 2025 · 2 comments
Closed

Non-native NullHandling not supported by JpaRepository #3729

demonfiddler opened this issue Jan 4, 2025 · 2 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@demonfiddler
Copy link

The org.springframework.data.domain.Sort.NullHandling API provides for NULLS_FIRST and NULLS_LAST but in practice anything other than NATIVE throws UsupportedOperationException at org.springframework.data.jpa.repository.query.QueryUtils.java line 757:

		if (order.getNullHandling() != Sort.NullHandling.NATIVE) {
			throw new UnsupportedOperationException("Applying Null Precedence using Criteria Queries is not yet supported.");
		}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 4, 2025
@christophstrobl
Copy link
Member

Null Precedence using Criteria Query is specified with JPA 3.2 (https://jakarta.ee/specifications/persistence/3.2/). Before that, we cannot set null precedence through the API. Spring Data JPA 4.0 will be based on JPA 3.2

@demonfiddler
Copy link
Author

Okay, thanks Christoph, I'll look out for SDJPA-4.0. Guess I was thrown by its inclusion in the API before it was actually supported. I can temporarily rework my application to route such queries to my existing custom repository implementation that does support Null Precedence in queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants