Migrating from Hibernate 5 to 6 results in error that target lists have at most 1664 entries

This is mentioned in the migration guide for 6.0: hibernate-orm/migration-guide.adoc at 6.0 · hibernate/hibernate-orm · GitHub

You can either specify a max fetch depth to reduce the amount of joins or even better, try to get rid of EAGER fetching, because it’s a pain and cripples performance.