I have a named query that has some required parenthesis
statement 1 and (satatement 1.1 or statement 1.2)
and HQL convert it to
statement 1 and statement 1.1 or statement 1.2
in my case to make it work I have to add statement 1 twice to have the correct result.
statement 1 and statement 1.1 or statement 1 and statement 1.2
I won't give you the whole name query unless you asked for it but in my case it was something like:
From User user
Where user.id = :userId AND (user.assetCount>0 or user.permission.canCreateAsset = true)_
Hope it makes sense.
Spring with hibernate ans MariaDB 10.