Here are the table mappings:
A club has multiple teams, nothing special.
Note the `@OrderBy` annotation to sort the list. Sort logic in human language: if "over" then by age group ascending, if under by age group descending, then by gender DESC, then by ordinal nbr
This fails with an exception:
According to https://stackoverflow.com/questions/31701286/how-to-use-case-when-in-jpa this can/should work.
I've been asking this question on SO BTW here: https://stackoverflow.com/questions/59587201/jpa-hibernate-case-in-orderby-annotation-throws-exception-unexpected-token-ca
I will try to get a test case ready, hopefully right with a PR.
Hibernate 5.3.6.Final, also tested with 5.4.10.Final, MySQL 8, HSQLDB, Java 8, WildFly 14.0.1.Final