Details
-
Bug
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
None
-
-
Spitfire Sprint 149
-
3
-
Spitfire
-
Nolana (R3 2022)
-
Lack of testing
Description
After analyzing MODNOTES-244, it was noticed that the root cause of the bug is in the folio-spring-base module.
toCountCriteria(String cql) method does not work as expected in Cql2JpaCriteria.class.
Steps to Reproduce:
To reproduce the bug just add below test to JpaCqlRepositoryTest.class and run this unit :
@Test void testSelectAllRecordsWithLimit() { var page = personRepository.findByCQL("city.id==2", OffsetRequest.of(0, 1)); assertThat(page) .hasSize(1); }
Expected Results:
The above unit test should pass and maybe need additional tests according to the implementation.
Actual Results: throws this exception:
Caused by: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=generatedAlias2,role=org.folio.spring.cql.domain.Person.city,tableName=city,tableAlias=city2_,origin=person person0_,columns={person0_.city_id,className=org.folio.spring.cql.domain.City}}]
[select count(generatedAlias0)
from org.folio.spring.cql.domain.Person as generatedAlias0
left join generatedAlias0.city as generatedAlias1
inner join fetch generatedAlias0.city as generatedAlias2 where generatedAlias1.id=2]
TestRail: Results
Attachments
Issue Links
- has to be done before
-
FOLSPRINGB-74 Release folio-spring-base v5.0.0 Nolana (R3 2022)
-
- Closed
-
-
FOLSPRINGB-77 Release folio-spring-base v5.0.1 Nolana (R3 2022)
-
- Closed
-
- relates to
-
FAT-2997 Review of C360558 test case
-
- Closed
-
-
MODNOTES-244 GET /notes type.id=X fails if limit <= number of results
-
- Closed
-
-
UXPROD-3677 NFR : Enhancements/Bugfixes/Tech Debt (Nolana)
-
- Closed
-