Query
{noformat}select contact from (select numeredContact, row_number() over(partition by numeredContact.name, numeredContact.phone) as num from Contact numeredContact ) as contact where contact.num = 1{noformat}
throws
{noformat}Caused by: java.lang.IllegalArgumentException: Component at index 0 has no alias, but alias is required{noformat}
Found this bug while usin spring data with spring boot 3 which using hibernate-core 6+ version.
I prepared [reproducer project|https://github.com/fnasibov/WindiwedFunctionIssue] with hibernate(without spring) and with spring boot 3 [here|https://github.com/fnasibov/exploringStarters]. Same query but native work well, So as i debugged: component with index 0 has alias but when i try in debugger component.getAlias() it return null (added screenshot with debugger) in class org/hibernate/query/derived/AnonymousTupleType.java:59
Hope it wil be helpful !
!image-20230731-212312.png|width=1460,height=977! |
|