-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Labels
status: ideal-for-contributionAn issue that a contributor can help us withAn issue that a contributor can help us withtype: enhancementA general enhancementA general enhancement
Milestone
Description
Using selectOne
on a query with multiple results obviously throws a "non unique result" exception. When the query is limited to 1, it still throws:
return template.selectOne(
Query.query(
Criteria.where("notificationId").isEqual(notificationId)
)
.sort(Sort.by("serverTimestamp").ascending())
.limit(1), // <----
MyEntity::class.java
)
.awaitSingleOrNull()
In the query log I see that the limit is set to 2 instead of 1.
org.springframework.dao.IncorrectResultSizeDataAccessException: Query [SELECT my_entity.* FROM my_entity WHERE my_entity.notification_id = $1 ORDER BY server_timestamp ASC LIMIT 2] returned non unique result.
This makes me think it's a bug because the limit seems to be ignored?
Metadata
Metadata
Assignees
Labels
status: ideal-for-contributionAn issue that a contributor can help us withAn issue that a contributor can help us withtype: enhancementA general enhancementA general enhancement