The query inSpring Boot 3.1.0/Hibernate 6.2.2 is fine:
Hibernate: select a1_0.id,a1_0.created_date,a1_0.db_version,a1_0.expiry_date,a1_0.last_used,a1_0.name,a1_0.project_id,a1_0.public_part,a1_0.role_id,a1_0.secret_key_hash,a1_0.updated_date from api_key a1_0 left join role r1_0 on r1_0.id=a1_0.role_id where a1_0.project_id=? order by r1_0.name offset ? rows fetch first ? rows only