Comments (5)
Oliver Drotbohm commented
Fixed with d108bc9
from spring-data-jpa.
Oliver Drotbohm commented
I implemented the fix for a Specification
not returning any object. This will result in null
being returned now. However I haven't changed the code to implement an arbitrary result in case of multiple objects being returned as we don't have no control over the ordering in that case so that multiple calls to the same data store could result in differing results.
Would it suit you simply calling findAll(Specification spec)
and use the first one returned?
from spring-data-jpa.
Oruganti Shanker commented
Yes, what you propose is the best solution. There will be a difference in the findOne behavior when using MongoDB vs Oracle, but we can't avoid a few such differences (;-))
from spring-data-jpa.
Oliver Drotbohm commented
Well I think we could restrict the MongoDB version of findOne(…)
to align to that convention. So we would stay consistent and could outline the way I proposed in the comment above in the documentation as a workaround
from spring-data-jpa.
Oruganti Shanker commented
I would say we leave things the way they are now. The Mongo users of the API would expect findOne to return one object, as the Mongo API does. So the best way is to have findOne return what the Mongo API returns.
from spring-data-jpa.
Related Issues (20)
- Problem with Spring Data JPA with projections, specifications and SPEL HOT 3
- Repositories do not support collections mapped to SQL arrays HOT 1
- Suboptimal specification queries for object arrays HOT 5
- Broaden integration test runs against Hibernate 6
- Projections with findBy select can't / doesn't trim fields
- Spring Data JPA creates a query according to method name regardless of existing named query HOT 1
- JPA projection cannot project OffsetDateTime from timestampz HOT 3
- Release 3.1.12 (2023.0.12)
- Release 3.2.6 (2023.1.6)
- Release 3.3 GA (2024.0.0)
- Derived Method Unneccessarily Joins for filter HOT 1
- Spring Data JPA Query with Class Constructor: org.hibernate.query.SemanticException: Cannot compare ... HOT 4
- Using native Hibernate multitenancy with Spring Data JPA breaks on application boot. HOT 7
- JpaSpecificationExecutor distinct find by with limit HOT 4
- Spring Data JPA generates incorrect JPQL query for sorted pagination request with UNION clause HOT 1
- Column "X" must appear in the GROUP BY clause or be used in an aggregate function HOT 3
- Unable to determine SQL type name for column 'option_type' of table 'account_options' because there is no type mapping for org.hibernate.type.SqlTypes code: 2000 (JAVA_OBJECT) HOT 1
- Missing implicite entityManager.flush() before storedprocedure call and Spring-Data Repository HOT 2
- Bug: Missing implicite entityManager.flush() before storedprocedure call and Spring-Data Repository HOT 3
- Error executing DDL HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-jpa.