We came across the following JQL query (which admittedly is not very useful as usedBy is actually mappedBy=uses - but I guess this can be reproduced with more useful ones) which starting with some changes in 5.2.3-5.2.4 (cannot really test 5.2.3 as this is broken for another reason) produces an query that derby considers invalid, although I'm not exactly sure why - Derby bug? The trigger seems to be that the inverse relation join now is replaced by a subquery.
Results in SQLSytaxErrorException:
Column 'ABSTRACTCO4_.ID' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'ABSTRACTCO4_.ID' is not a column in the target table.
Query in 5.2.2:
Apache Derby 10.13.1.1 (10.12.1.1 also)
You can disable the subquery rewriting behavior in 5.2.4 now with the property hibernate.collection_join_subquery. Also see https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#configurations-misc
Could you maybe also share the entity model so I can understand what is happening there?
Will try with the property disabled, thanks.
The model unfortunately is pretty huge, but for the parts I guess might be relevant:
I am able to reproduce it, investigating now.
Feeling a bit embarrased. I had extra spaces in the regex pattern which was fine for the case when using the operator like but not any other operator since the spaces there are omitted. The fix in the PR should solve your issue: https://github.com/hibernate/hibernate-orm/pull/1615
Fixed in 5.1 as well.