borinquenkid opened a new issue, #16808:
URL: https://github.com/apache/grails-core/issues/16808
Split from monolithic audit #16674 (findings F4, F6, F23, F23b, F3).
### Problem Description
The criteria API has gaps in type safety annotations and query settings
propagation:
1. **`@DelegatesTo` Missing on `GormEntity` (F4)**:
`GormEntity.where`, `whereLazy`, `whereAny`, and `findAll` lack
`@DelegatesTo(DetachedCriteria)` annotations, making them difficult to use
cleanly with `@CompileStatic`.
2. **Query Arguments Map Dropped on Criteria (F23, F23b)**:
- Calling `readOnly(true)` or `cache(true)` on a `DetachedCriteria` had
no effect on execution.
- Hibernate query settings passed via arguments maps (`readOnly`,
`cache`, `fetchSize`, `timeout`, `flushMode`) were dropped for criteria
queries. `HibernateQuery` should implement `QueryArgumentsAware` so settings
reach the underlying query.
3. **Compile-Static Coverage & Criterion Handler Completeness (F6)**:
Add compile-static verification and completeness tests for criteria
translation to guard against missing criterion handlers at runtime.
4. **Contract for `singleResult` with Multiple Rows (F3)**:
Clarify and standardize the contract for `singleResult` across the API
when more than one row matches (fail loudly vs returning the first row).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]