I've also stumbled upon this. It seems that in Hibernate 6.6 Expression.as(String.class)
no longer generates an SQL CAST. It is now just an unsafe Java type cast. To use LIKE on a numeric column you must explicitly cast via JpaExpression#cast
It's part of the Migration Guide