If @OneToMany has mappedBy which is mapped using @JoinColumnsOrFormulas with formula, then there is ClassCastException.
I have seen some similar bugs, but they all are fixed/closed. Maybe it is a duplicate. Simple example attached.
It looks like trying to map OneToMany directly over JoinColumnsOrFormulas fails with the same exception.
Years later, hibernate version 5.4.0, the bug still exists....
The following code block of TableBinder:java:584 is simply dangerous, since the iterator mappedByColumns returns org.hibernate.mapping.Selectable instances, which are either implemented by org.hibernate.mapping.Column or org.hibernate.mapping.Formula. Therefore, a cast to Column without any check is a bad idea. I guess Formula need some special treatment or at least a decend error message.