We are in the migration process from Hibernate 6 to Hibernate 7.
And we encountered a performance issue with large filter conditions.
In our application, there are filter conditions > 2000 characters (including whitespaces)
We add these filters based on our custom annotation at runtime.
Application startup time increased from 15 seconds to 300 seconds.
After debugging the Hibernate code, we have found that the issue is in the method:
org.hibernate.sql.Template#renderWhereStringTemplate
That method runs on the initialization of EntityPersisters from org.hibernate.persister.entity.AbstractEntityPersister#AbstractEntityPersister
The performance issue is in the method
org.hibernate.sql.Template#isFunctionCall
That code was changed in the 7th version.
Any thoughts/suggestion how we can solve this or avoid this behavior?